bpayne111 Posted March 4, 2003 Posted March 4, 2003 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? Quote i'm not lazy i'm just resting before i get tired.
AndreRyan Posted March 4, 2003 Posted March 4, 2003 Me.Refresh triggers a Paint Event Quote .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?
*Gurus* divil Posted March 4, 2003 *Gurus* Posted March 4, 2003 You should call Invalidate() then Application.DoEvents() if you're running in a loop, if not, skip the DoEvents part. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
bpayne111 Posted March 4, 2003 Author Posted March 4, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
*Gurus* divil Posted March 4, 2003 *Gurus* Posted March 4, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
bpayne111 Posted March 4, 2003 Author Posted March 4, 2003 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? Quote i'm not lazy i'm just resting before i get tired.
*Gurus* divil Posted March 4, 2003 *Gurus* Posted March 4, 2003 In your case it probably doesn't make much difference :) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.