c# - Windows mobile message box this.close()? -


On the Windows Mobile 6.1 professor.

I have a Yes / message box with a button. When I click on the 'No' option in the message box, my whole application shuts down, how can I close the message box?

  string message = "will you agree to download application data?"; String caption = ""; Message box button button = message box Yes No; DialogResult Results = MessageBox.Show (Message, Caption, Button, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); If (Results == DialogResult.Yes) {navigateForward (WEB_PAGE_NAVIGATE); } Other {This. Close (); }  

You do not need to close the message box. This is a DialogWindow and will close itself when you click on any of the options:

  DialogResult result = MessageBox.Show (); If (Results == DialogResult.Yes) {navigateForward (WEB_PAGE_NAVIGATE); } Else {// do not need to do anything in the form of a message box, is automatically closed}  

For this reason your entire application has been closed because it belongs to the class you are currently doing. I think this class is your main code> form and when your main form closes, the application closes


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -