Jump to content
Xtreme .Net Talk

well..


Recommended Posts

Guest Nightmare
Posted

I did this and I still get a flicker:

setstyle(ControlStyles.UserPaint, True)
setstyle(ControlStyles.AllPaintingInWmPaint, True)
setstyle(ControlStyles.DoubleBuffer, True)

 

?

 

*oops...this should have been in reply to my last post..*

Guest Nightmare
Posted

Well that's where I do my drawing...

 

However, since I'm using QueryContinueDrag, and the Paint event never gets called when a control is being dragged, I had to invoke the paint event myself.

 

In the paint event I do a CreateGraphics.Clear and then a CreateGraphics.DrawImage...and it seems like because I am constantly clearing, and then drawing the image, that there is a flicker...though I obviously must be doing something wrong.

 

This is the only way I can think of to keep the image under the mouse as I'm dragging it without actually moving the PictureBox...

 

The only solution that I can see to my problem is using an API and I don't want to do that. I know BitBlt would work though, as it did in VB 6 (and this program is one that I'm converting to VB.NET from a working VB 6 program for practice).

 

Any ideas? Am I an idiot?

  • *Gurus*
Posted
You shouldn't be using CreateGraphics. That defeats the point of all the double-buffering and painting management that is there for you. You should be using the Graphics object passed to the Paint event through e.Graphics. Then it knows what to do with it.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...