By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Flickering while refreshing

P: n/a
Hi,

I'm using a UserControl object for all the graphics handling in my
application. However, if I select an image and move it around, I get
flickering. So in order to get rid of the flickering, I added this code in
the constructor of the UserControl:

this.SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);

Now the control doesn't flicker, but I still get some minor flickering of
the image I am moving, and if I move the mouse too quickly, the image will
not "keep up" with the mouse pointer.

Any suggestions?
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
how exactly are you moving that image around? If you are doing all
your painting to the Graphics object that comes through onpaint then
if your using doublebuffer and all painitng in paint you shouldn't get
any flicker at all. Are you instead using a second control and
painting on that perhaps?

Also, are you overriding OnPaintBackground?

Allen Anderson
http://www.glacialcomponents.com
mailto: allen@put my website url here.com

On Mon, 19 Apr 2004 12:43:21 -0400, "Jack Smash"
<so*****@somewebsite.com> wrote:
Hi,

I'm using a UserControl object for all the graphics handling in my
application. However, if I select an image and move it around, I get
flickering. So in order to get rid of the flickering, I added this code in
the constructor of the UserControl:

this.SetStyle(ControlStyles.AllPaintingInWmPain t |
ControlStyles.DoubleBuffer, true);

Now the control doesn't flicker, but I still get some minor flickering of
the image I am moving, and if I move the mouse too quickly, the image will
not "keep up" with the mouse pointer.

Any suggestions?


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.