Search code examples
c#winformsonpaint

Easiest way to show update on a form when stucked in a function (OnPaint) for a long time


I am loading something that takes a long time in OnPaint function the first time I run my program, and I need a way to show my progress. I already have the progress stuff up, but I just don't know the simplest way to show it.

Want either

  1. Something to keep the form responsive when stucked in OnPaint function for a prolonged period, I am changing the title name to show progression and I want the form to stay responsive!

  2. Pop up something else that is easily created to show progress

btw, I am loading it only OnPaint because I wanted the form to show up so that the user will know that the program opened correctly. Otherwise nothing will happen while the form loads, and the user might think that the program was not even opened.


Solution

  • DoEvent

    As per mentioned by Jeremy Thompson, many thanks

    Though I need to wait 2 days to be able to accept this answer.