File tree Expand file tree Collapse file tree 2 files changed +290
-312
lines changed
csharp/VS_Snippets_Winforms/MessageBox.Show Variations/CS
visualbasic/VS_Snippets_Winforms/MessageBox.Show Variations/VB Expand file tree Collapse file tree 2 files changed +290
-312
lines changed Original file line number Diff line number Diff line change @@ -104,40 +104,27 @@ private void button1_Click(object sender, System.EventArgs e)
104104
105105 }
106106
107- //<snippet1>
108-
107+ //<snippet1>
109108 private void validateUserEntry ( )
110109 {
111-
112110 // Checks the value of the text.
113-
114111 if ( serverName . Text . Length == 0 )
115112 {
116-
117113 // Initializes the variables to pass to the MessageBox.Show method.
118-
119114 string message = "You did not enter a server name. Cancel this operation?" ;
120- string caption = "Error Detected in Input" ;
115+ string caption = "Error Detected in Input" ;
121116 MessageBoxButtons buttons = MessageBoxButtons . YesNo ;
122117 DialogResult result ;
123118
124119 // Displays the MessageBox.
125-
126120 result = MessageBox . Show ( message , caption , buttons ) ;
127-
128121 if ( result == System . Windows . Forms . DialogResult . Yes )
129122 {
130-
131123 // Closes the parent form.
132-
133124 this . Close ( ) ;
134-
135125 }
136-
137126 }
138-
139127 }
140-
141128 //</snippet1>
142129
143130 //<snippet2>
You can’t perform that action at this time.
0 commit comments