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

asked on

c# winforms class to display 'please wait'

Hi

I am trying to create a class that displays a message in a panel which is centered on the screen... a simple 'please wait' would be fine, so that I can call something like

busy()

to display the message no matter what form is open in the application...

Any ideas how I get this to work?

Cheers

CD
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Basically just how you described it.  Just use the .Show() method to show the window - that does not wait at that point.  In the form properties there is a setting for it to display centrally.

eg.
MyWaitForm frm = new MyWaitForm();
frm.Show();
....  //your code goes here
frm.Close();
Avatar of cycledude

ASKER

ah i see, so create a form with the message in it and then display the form...
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
so simple

I was thinking of creating a class, which created a panel in code then added a label and an image, then set the message... but this is way easier.. thanks
;o)
The trick is the .Show() so it doesn't block the code.  However it does require you to close the form from code yourself.