duta
asked on
VB 2005: How to Make MessageBox Disappear automatically?
Dear Experts:
I wonder whether there is a way to make a message (MessageBox.Show) to disappear automatically after three seconds of display so that the user don't have to click to close the box.
Thanks a lot!
I wonder whether there is a way to make a message (MessageBox.Show) to disappear automatically after three seconds of display so that the user don't have to click to close the box.
Thanks a lot!
The better solution is to create your own messagebox, but you can also do a walkaround and use send keys to close it. It's not 100% safe because the user can change the focus to another point, but most of the times it will work.
ASKER
YOU SAID: to create your own messagebox,
MY QUESTION: Can you kindly give me a sample code?
Thanks!
MY QUESTION: Can you kindly give me a sample code?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A message box is nothing other than a form.
Create a form with a timer control and label. Overload Show() method of the form to get a string. When this method is called create a form assign the string to the label and start timer. On timer event when it reaches 3 minutes close the form
Create a form with a timer control and label. Overload Show() method of the form to get a string. When this method is called create a form assign the string to the label and start timer. On timer event when it reaches 3 minutes close the form
ASKER
Thanks a lot for your kind tips.
I am a total novice. It may take a while for me to figure it out probably through
countless trial and errors.
It seems a little daunting task.
If you can kindly offer me a complete code, it will be tremendously appreciated.
But I know it may be too much for you :)
Thanks!
I am a total novice. It may take a while for me to figure it out probably through
countless trial and errors.
It seems a little daunting task.
If you can kindly offer me a complete code, it will be tremendously appreciated.
But I know it may be too much for you :)
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried jpaulino's frmMessage.
It worked fine. But there is a little problem.
The form is displayed away from the main form.
Is there a way to make the frmMessage displayed in front of the main form>
Thanks!
It worked fine. But there is a little problem.
The form is displayed away from the main form.
Is there a way to make the frmMessage displayed in front of the main form>
Thanks!
have you tried my example?
ASKER
emoreau, I tried your tip.
I found one too many text in the MessageBox, which I am afraid may be a little distracting.
I also found that jpailino.s frmMessage was more friendly to custom-make :)
I am a total novice. My observation may be wrong.
Thanks!
I found one too many text in the MessageBox, which I am afraid may be a little distracting.
I also found that jpailino.s frmMessage was more friendly to custom-make :)
I am a total novice. My observation may be wrong.
Thanks!
>>I found one too many text in the MessageBox
You put what you want. I have created many options as people often want many features but you don't have to use them all!
You put what you want. I have created many options as people often want many features but you don't have to use them all!