public void MyMouseDown(Object sender, MouseEventArgs e) { Graphics graphics = CreateGraphics(); int linh = System.Int32.Parse(textBox3.Text); graphics.FillRectangle(new SolidBrush(Color.White), e.X, e.Y, linh, linh); SelectRect.Width = 0; SelectRect.Height = 0; SelectRect.X = e.X; SelectRect.Y = e.Y; SelectRect.Width = linh; SelectRect.Height = linh; } public void MyMouseMove(Object sender, MouseEventArgs e) { Graphics graphics = CreateGraphics(); int linh = System.Int32.Parse(textBox3.Text); graphics.FillRectangle(new SolidBrush(Color.White), e.X, e.Y,linh,linh); SelectRect.Width = 0; SelectRect.Height = 0; SelectRect.X = e.X; SelectRect.Y = e.Y; SelectRect.Width = linh; SelectRect.Height = linh; Form thisform = (Form)sender; ControlPaint.DrawReversibleFrame(thisform.RectangleToScreen(SelectRect), Color.Black, FrameStyle.Dashed); }
Graphics
System.Windows.Graphics
System.Windows.Control.Paint
System.Windows.Control.OnPaint
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)