Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh() vs. Invalidate()
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01051537
Message ID:
01051690
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform