counter, timer ?

torg

Regular
Joined
Nov 7, 2002
Messages
60
Location
Norway
I`ve got at button btnSave.
when i push this button a messagewindow
messagebox.show("It`s all saved") should pop up for an amount of time i.e 5 sec. Could anybody give me an code example on how to achieve this?
 
That`s a good Idea. Thanks, but I still have a problem: to create a counter, timer or what can be used to make the window open for i.e. 5 sec and the close, by using a button to trigger the event.
 
If you want the open form to close itself, use a Timer on the form. The event would just call "Me.Close()" in VB or "this.Close();" in C#.

The button would do the same thing.

If you want a button on the opening form to close the popup, you can't, or shouldn't be able to. Hopefully your new form that mimics a messagebox is being shown modal so that the opening form won't accept any messages (like a button click).

There's also an article in MSDN mag (click here). It's a bit advanced, using Windows hooks, but does allow what you want using the built-in message box. It's not light reading!

-nerseus
 
Back
Top