Absent Member.
Absent Member.

Message Box Timeout?

 I've been using the message box (Windows) for long time, and once in a while a message box will hold up a process from finishing.  Is there any way to code a timeout on a message box and force the default response after say X number of seconds?


The message box variables I'm familiar with are TEXT, TITLE, TYPE, ICON, DEFAULT (response), VALUE 


1 Reply
Micro Focus Expert
Micro Focus Expert

RE: Message Box Timeout?

From what I can tell, the standard MessageBox class does not implement a timer functionality. It is recommended that you instead create your own messagebox class using a standard form and then add a timer to it's Load method.

You don't mention what version of the MessageBox class you are using. Is this for WinForms, WPF, native code, etc?

I assumed that you are using WinForms so I created a simple example based on that technology. 

I have attached it to this reply.


The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.