Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a windows Form written in C# 2010 with .net 4.0. A very annoying problem is when one drags a window or anything over it the viewing data is images of the window that was just pulled over it. This form is doing large amount of data/ file moving and there are large periods that the form is not being updated. I have added " Application.DoEvents()", and "this.Invalidate()" , and "Update()" and "Refreshes()" to no avail. I need to know how to stop the imaging of another window on top of my form when dragged accost it. I would also like to be able to click on the form at any time and cause it to become in focus and to raise to the top level.
Any information on how to do this would be helpful.
Posted

1 solution

Gosh, don't do DoEvents! You only need Invalidate, but this should be a part of your System.Windows.Forms.Control rendering even if you are not moving anything, but you picture is being modified (like in animation). If's likely that you have some problem in rendering or data presentation itself, but you did not show anything. In other words, normally you would not need to do anything special to handle dragging of your form.

First, you could try to make a complete but short code sample which would manifest this problem and post it in your question. If you choose to do that, use "Improve question". (I mean don't repeat a very common mistake many inquirers do: don't post it as "solution".) By the way, by making this short sample you will get an extra chance to figure out the problem by yourself.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900