Gav,
After duplicating the error, here's what I came up with:
I created a WinApp with MainForm as MdiParent = True, an EventsForm and
CalendarDialog
On MainForm I placed a button with this code:
EventsForm frm = new EventsForm();
if ( frm.CheckDate() == DialogResult.Ok )
{
frm.MdiParent = this;
frm.Show();
}
On EventsForm I added the CheckDate() method:
public DialogResult CheckDate()
{
return new CalendarDialog().ShowDialog();
}
CalendarDialog has 2 buttons, 1 with DialogResult = Cancel, the other
DialogResult = Ok
Things work as expected.
I thought about the "elegance" of the solution, and decided EventsForm is a
class, with exposed methods and properties like any other class, so
justified it that way :)
Or, you can say that a pre-condition for EventsForm to load is that it has a
valid date to load data with.
Ron
> Thanks for the reply Ron, what you mentioned is exactly what I'm after,
> however where exactly do I call the method which checks for the date? If I
[quoted text clipped - 46 lines]
>>> Regards
>>> Gav
Gav - 26 Aug 2005 13:47 GMT
Thanks again for the reply Ron... your theory sounds very reasonable I will
give it a try ASAP.
Cheers
Gav
> Gav,
>
[quoted text clipped - 82 lines]
>>>> Regards
>>>> Gav
Gav - 26 Aug 2005 14:10 GMT
That is working perfectly thanks for the help
> Thanks again for the reply Ron... your theory sounds very reasonable I
> will give it a try ASAP.
[quoted text clipped - 88 lines]
>>>>> Regards
>>>>> Gav