Question about the MessageBox

C

Claudia Fong

Hi,

I have a MessageBox showing a message that the data has been added. It's
a messageBox containing a MessageBoxButtons.OK. I would like to after
the messagebox show and I click on button OK, all the textBox.Text will
be clear

textBox1.Text = ""
textBox2.Text = ""
textBox3.Text = ""

MessageBox.Show("The data has been added","Add department
name",MessageBoxButtons.OK,MessageBoxIcon.Information);


Cheers!

Claudi
 
B

Bruce Wood

I'm not sure I understand your problem clearly. If you want to clear
the text boxes after the user clicks OK in the message box, why not
just put the code you posted to clear the text boxes after the
MessageBox.Show()? MessageBox.Show() is modal, so the next line of code
won't run until the user dismisses the message box.

That's why I think I must be missing something...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top