tonofsteel Posted August 27, 2003 Posted August 27, 2003 I open a form using the showdialog. When the form closes I need to test if the cancel button or the ok button was pushed on my form. How do i do this? Quote
*Experts* mutant Posted August 27, 2003 *Experts* Posted August 27, 2003 First you need to set the DialogResult property for those buttons to OK and Cancel. Then you show the dialog like this: If dialogform.ShowDialog() = DialogResult.OK Then 'do something when ok is pressed End If Same goes for cancel but DialogResult.Cancel instead of DialogResult.OK. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.