Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This takes some explanation. I am writing C# library that will reside on a printer running Linux/Mono. The printer has an touch screen LCD and I am writing UI elements for the the display. One of the things I need to write is a Message box. I have that done but I need to know how to write the constructor so that it MessageBox runs in a different thread and suspends the main thread until one of the buttons in the MessageBox buttons is pressed.

In other words, make it operate like a Windows Forms Message box

Thanks
Posted
Comments
Richard C Bishop 2-Oct-13 15:14pm    
Can you not inherit from the Windows Forms Message box?
Ravi Bhavnani 2-Oct-13 15:40pm    
Google tells me a MessageDialog() should work. Have you tried that?
Sergey Alexandrovich Kryukov 2-Oct-13 16:15pm    
You can do it using Control.Invoke, but the whole idea is bad. You need to rethink the general code design.
Can you explain the ultimate goals of all that?
—SA
johannesnestler 2-Oct-13 16:21pm    
MessageBox on different thread? Maybe think again about your architecture - and creating all UI from scratch can be hard - have you considered something like this: http://www.mono-project.com/WinForms (first hit on Google for me)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900