ShowDialog not closing

  • Thread starter Thread starter Sunit Joshi
  • Start date Start date
S

Sunit Joshi

Hello All
I have a baseForm in which I have a bntOk with DialogResult set to OK.
Now I have a derived form, ObjProp. This I show in code but somehow
the btnOk Click event does not seem to occur.


using(ObjProp propDlg = new ObjProp())
{
if(propDlg.ShowDialog()==DialogResult.Ok)
{
//Do something....Code never reaches here.
}
}
 
Hi, Sunit

do you have any code running in btnOk.Click handler? By itself code snippet
you posted looks Ok.

HTH
Alex
 
* (e-mail address removed) (Sunit Joshi) scripsit:
I have a baseForm in which I have a bntOk with DialogResult set to OK.
Now I have a derived form, ObjProp. This I show in code but somehow
the btnOk Click event does not seem to occur.

Call the form's 'Close' method in the handler.
 
You could also just set the ok button's DialogResult property to
DialogResult.OK. That way, when the user clicks the button the form's
DialogResult property will be set and the form will be closed.

Kent
 
Back
Top