Advertisement

C# Tool render window erasing on scroll and won't redraw until mouse release

Started by July 07, 2012 10:43 PM
-1 comments, last by ayane 12 years, 4 months ago

Hello!

So I am creating a tool in C# which has basically only 2 panels in it at the moment; the left panel has all the buttons and stuff like that for editing. Then a panel on the right which is for drawing. The panel for drawing is a custom class i made which is just a panel with double buffering enabled. I am using directX to render things, the render function is called after the form is created and replaces the standard Application.Run() that is generated by Visual studios.


The Problem:

Anytime I scroll down (using panels auto scroll) in the rendering panel I get blank space until I let go of the mouse button. The same thing will happen if i move the panel out of view (like all the way off the screen) then drag it back without letting go.

Ive searched for a while on google for it; I've read that about OnPaint and OnPaintBackground will sometimes fight for control in situations like this or something of that sort. So i tried overriding them to do nothing and it didnt change anything. I've also tried invalidating the window after every render as well; which didn't work either.

Does anyone have any idea what I should be doing here?



Thanks

This topic is closed to new replies.

Advertisement