Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When the user clicks the mouse i'd like to set a couple of variables and then redraw the form.

Should i call the paint event directly or use Me.Refresh?

is thier a difference in using one or the other?

i'm not lazy i'm just resting before i get tired.
Posted
Me.Refresh triggers a Paint Event
.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted

i'm using me.refresh as of now and everything is lovly (thanks to posts from this forum)

What is this invalidate you speak of?

i'm not painting in a loop so i guess it doesn't matter but, i'm still curious

 

thanks

i'm not lazy i'm just resting before i get tired.
  • *Gurus*
Posted

Refresh forces the component to redraw itself immediately, and it is often not necessary to do this. Invalidate marks the control's surface as invalid, and next time the program is idle (i.e. when you have finished processing) windows will initiate the repaint itself.

 

Personally I prefer Invalidate. Imagine in a large program you do several things in one loop that require the display to get redrawn. Calling Refresh each time would take time, but once a display is marked invalid you can go on marking it invalid any number of times, it is only redrawn when required.

 

In a great deal of cases, both work equally well.

MVP, Visual Developer - .NET

 

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

 

My free .NET Windows Forms Controls and Articles

Posted

in my case... i have a loop that defines all my rectangles and images... once the loop is finished i'm calling me.refresh.

 

when the mouse moves i reinitialize one value and call refresh again.

 

i'm using doublebuffering on the control and i have no flicker at all.

 

i'm thining i should stick with me.refresh am i wrong?

i'm not lazy i'm just resting before i get tired.

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...