redraw line drawn at runtime
-
hi, i need to know how to redraw a line drawn at runtime on a windows form control.the problem i'm facing is that evrytime the scrollbar is moved the line drawn dissappears. i cannot add the line drawing to the onpaint method as the line is created in reponse to a mouse click event. Thanks, mats_mathai.
-
hi, i need to know how to redraw a line drawn at runtime on a windows form control.the problem i'm facing is that evrytime the scrollbar is moved the line drawn dissappears. i cannot add the line drawing to the onpaint method as the line is created in reponse to a mouse click event. Thanks, mats_mathai.
In the future, you'll probably get a much better response if you posted this to the C# forum instead of here. This forum is for ASP.NET questions, and yours is WinForm based. That being said, you will have to redraw the line in the
OnPaint
method when the form is repainted. Scrolling the form is one of the things that will cause a form to repaint, which is clearing the line you draw in the mouse event handler. What I would recommend is that you continue to draw the line initially in the mouse event handler, but keep a member level variable or two populated with the needed information so that you know when and how to redraw the line fromOnPaint
. Hope that helps. :) --Jesse