Friday, 13 September 2013

DateTimePicker DialogResult.OK

DateTimePicker DialogResult.OK

I have following code now:
var picker = new DateTimePicker();
var form = new Form();
form.Controls.Add(picker);
var result = form.ShowDialog();
if (result == DialogResult.OK)
{
//Can´t acces this
}
if (result == DialogResult.Cancel)
{
//Do when Form closed
}
When the form appears, there´s only picker on it, no buttons. Now I can
only acces result == DialogResult.Cancel when I close the form. What I
need to do to access branch with result == DialogResult.OK

No comments:

Post a Comment