04-04-2025, 09:52 AM
(04-03-2025, 09:22 PM)AbsoluteBeginner Wrote: When trying to draw with the mouse button pressed, there are problems with synchronization.![]()
What requirements must be met when organizing the simultaneous operation of an event handler and the process of drawing an image on the Graphics window?
All interface updates only occur on the main UI thread, so best to not do this in an event subroutine as they only get done when the event subroutine ends and this can cause issues in an event that occurs often or takes some time.
The recommended approach is to set flags in event subroutines and do the UI work in a message loop.
This is an article I wrote on this for the old forum, https://learn.microsoft.com/en-us/archiv...ent-basics.