Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh() vs. Invalidate()
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01051537
Message ID:
01051697
Views:
6
Viv,
Thank you very much for your reply. I am glad to hear that you use Invalidate() and that you are familiar with drawing using GDI+. I just pulled out my GDI+ book from v1.0 and the author also uses Invalidate(). After your reply and the book text I feel comfortable using Invalidate().
Again thanks.
Einar
>Hi,
>
>>>
>Thank you for the reply. Are you using Refresh() or Invalidate() in your code?
>I did a little more reading about Invalidate() and it appears that the control will not be redrawn until there is an open time-slice to redraw (unless you issue Update() immediately following the Invalidate()).
>It appears that both methods work for my control.
>>>
>
>I think you're right. I believe the .NET .Invalidate() generates a WM_PAINT and, since this is a low priority message, the actual redraw won't normally occur until there's some processing time available. Presumably .Update() directly calls the Paint method (effectively 'jumping the queue'). From the help on .Refresh:
>"Forces the control to invalidate its client area and immediately redraw itself and any child controls." The 'immediately' seems to imply that .Refresh is the same as issuing:
>
>.Invalidate(True)
>.Update()
>
>All just supposition on my part though.
>In practice I only use .Invalidate() when I'm doing low level graphics stuff and overriding Paint() but I'd be hard put to it to justify the choice on logical grounds...
>Regards,
>Viv
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform