Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messagebox? 1

Status
Not open for further replies.

RoguePoet01

Programmer
Oct 1, 2003
302
US
Hi,

I'm just learning try/catch error handling, and I'd like to have a "response" message box pop up (sort of like in VB6) but I can't find the syntax/spelling for such a feat.

 
Code:
using System.Windows.Forms;

protected void button1_Click(object sender, System.EventArgs e) {
   if(textBox1.Text == "") {
      MessageBox.Show("You must enter a name.", "Name Entry Error",
         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
   }
   else {
      // Code to act on the data entered would go here.
   }
}

HTH
 
That looks great!

Don't know why I can't find anything about it in my books.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top