You can create a custom dialog box using forms. Putting a timer into a form class will be much simpler than modifying MessageBox class. You can change the FormBorderStyle and Size properties of the Form class to size a dialog box so that it's smaller like
messagebox.
Form.ShowDialog Method () can be used to show the form as a modal dialog box:
Zhao Ji Ma
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
jensonchew
Member
57 Points
149 Posts
How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 12:59 PM|LINK
Hi guys,
Does any of you know how to close a msgbox in .NET compact framework a few seconds after it has been displayed programmatically?
Any help or guidance would be highly appreciated.
Thanks.
Regards,
Jenson
florim
Member
353 Points
77 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 02:16 PM|LINK
Create your owne form and set timer on it.. to be close...
Shobana P.S
Member
479 Points
130 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 02:56 PM|LINK
Shobana
jensonchew
Member
57 Points
149 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 03:03 PM|LINK
Hi Shobaba,
I did try with timer , but I don't know how to send a "OK" to the msgbox to close it. No luck still.
Regards,
Jenson
Shobana P.S
Member
479 Points
130 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 04:10 PM|LINK
You can use javascript to trigger the message box' ok button. If this is not coming, then you can try finalise mehod to dispose the message box
Shobana
jensonchew
Member
57 Points
149 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Aug 30, 2007 04:23 PM|LINK
Hi Shobana,
Could you kindly point me to some sample codes or any tutorial to achieve that?
I'm really lost now. I tried not to use javascript as I'm using VS 2005 to code a program for a window CE 5.0 device.
Thanks.
Regards,
Jenson
Zhao Ji Ma -...
All-Star
23104 Points
2380 Posts
Re: How to close a msgbox after a a few seconds, programmatically?
Sep 05, 2007 12:57 PM|LINK
Hi Jenson,
You can create a custom dialog box using forms. Putting a timer into a form class will be much simpler than modifying MessageBox class. You can change the FormBorderStyle and Size properties of the Form class to size a dialog box so that it's smaller like messagebox.
Form.ShowDialog Method () can be used to show the form as a modal dialog box:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.showdialog.aspx
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”