Link to home
Start Free TrialLog in
Avatar of RIAS
RIASFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Application.doevents

Hello,
Is there a better and faster way of Application.doevents
Thanks
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

in which scenario are you using DoEvents? That will never speed up an application, it will only give some time to other thread like the UI thread to update
Avatar of RIAS

ASKER

Thanks! Its mainly about when the screen is refeeshing
there isn't much you can do (other then calling DoEvents) or you need to introduce tasking
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Similar to other comments, I would recommend putting the intensive processing into another thread so you shouldn't need to call Application.DoEvents() at all. You could use a background worker, ThreadPool.QueueUserWorkItem, task parallel library (aka async/await). I think async/await is probably the most familiar pattern for other programmers lately.
Avatar of RIAS

ASKER

Is system.windows.forms.application.doevents better ? than just Application.doevents?
The same.
Avatar of RIAS

ASKER

Thanks Andy!