2010-08-04 3 views
1

Windows Mobile 6.1 prof.Windows 모바일 메시지 상자 this.close()?

메시지 상자에 예/아니요 버튼이 있습니다. 메시지 상자에서 '아니요'옵션을 클릭하면 전체 응용 프로그램이 종료되고 어떻게 메시지 상자를 닫을 수 있습니까?

   string message = "Application will perform a data download agree?"; 
       string caption = ""; 
       MessageBoxButtons buttons = MessageBoxButtons.YesNo; 
       DialogResult result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); 

       if (result == DialogResult.Yes) 
       { 

        navigateForward(WEB_PAGE_NAVIGATE); 

       } 

       else 
       { 

        this.Close(); 

       } 

답변

3

메시지 상자를 닫지 않아도됩니다. 그것은 DialogWindow 그리고 당신이 옵션을 클릭하면 자체를 종료합니다.

DialogResult result = MessageBox.Show(); 
if (result == DialogResult.Yes) 
{ 
    navigateForward(WEB_PAGE_NAVIGATE); 
} 
else 
{ 
    // No need to do anything here as the MessageBox is closed automatically. 
} 

전체 응용 프로그램이 종료 이유는 this 클래스에 관련이 있기 때문에 당신이 현재 것입니다 내가 그 클래스를 추측하고있어 귀하 주 Form 주 양식이 닫히면 응용 프로그램이 종료됩니다.