C# – Moving a control around on the UI

ccontrolsnet

We are developing in C#.Net. We are dynamically changing a .Net control's location based on mouse movement. The control moves on the screen as expected, but, if the mouse moved too quickly strange redraw issues occur. The issues include only viewing part of the control and it not being fully visible until mouse movement stops. This occurs on any .Net control. We have been testing with the .Net button control. Is there any specific calls that have to be made to ensure the control is always redrawn even if the mouse movement is very fast.

Best Answer

If it's WinForms you use, then check out the Control.DoubleBuffered property.