X
keine ahnung warum das passiert.
hier kleine Abhilfe für dein Problem:
private void userControl11_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
Rectangle rect = new Rectangle(e.X - 50,e.Y - 50,100,100);
Bitmap bmp = new Bitmap(rect.Width, rect.Height);
SolidBrush pen1 = new SolidBrush(Color.FromArgb(200,255,0,0));
SolidBrush pen2 = new SolidBrush(Color.Black);
Graphics g1 = Graphics.FromImage(bmp);
g1.FillRectangle(pen2, 0, 0, bmp.Width, bmp.Height);
g1.FillRectangle(pen1, 0, 0, bmp.Width, bmp.Height);
g1.Dispose();
Graphics Graph = userControl11.CreateGraphics();
Graph.DrawImage(bmp, rect, 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel);
Graph.Dispose();
bmp.Dispose();
}