MessageBox issue


On NETCF V2, a message box is automatically closed if MessageBox.Show() is called after a form is closed. This is different behavior from NETCF V1 and Desktop (V1/V2).


To work around the issue, simply call Message.Show() on another thread with codes like this:


In the Main() function, add the following lines after Application.Run():


           Thread t = new Thread(new ThreadStart(DoWork));


           t.Start();


           t.Join();


Add the following method to the Form class:


static void DoWork()


{


            MessageBox.Show("finish");


}


Cheers,


Anthony Wong [MSFT]


This posting is provided "AS IS" with no warranties, and confers no rights.

Comments (0)

Skip to main content