tags:

views:

605

answers:

2

We have a fairly complicated GUI in windows forms using C# and .Net 2.0. My problem is that whenever I drag any window over the GUI, it leaves artifacts over the form. I can't for the life of me figure out how to eliminate it. I've tried enabling double buffering, but it only helps, doesn't eliminate the problem. Other applications don't seem to have this issue, and I'm wondering what we're doing wrong.

Update In Response to answers

Most of the application is just using a set of third party controls (Infragistics) laid out on a panel. As far as I can tell there is nothing getting done in the GUI thread besides basic(non-cpu intensive) mouse click handling.

+3  A: 

You might be doing too much work on the GUI thread. Off-loading some work to background threads will free the GUI up to process Windows messages more responsively.

Jon B
A: 

Related to Jon B's answer, if your application is doing a lot of drawing using the Graphics object in .NET, those methods are fairly slow relative to Windows API calls.

Another possibility is that your GUI might not be updating itself in the OnPaint event. Sometimes custom graphics code updates a drawing surface from a timer event, or else only updates the drawing surface when something changes in what needs to be displayed. Code written like this appears to work most of the time, but produces the problem that you describe when another window moves over your window.

MusiGenesis