M
Magnus Lindberg
Hi,
I'm working on a larger windows application in which I have a form that should
behave as an mdi-child or as a dialog depending on how it is diplayed. I thought
I'd display the form with ShowDialog() to get it modal and then at runtime check
for this.Modal in the form and set some properties.
This however, does not seem to work as this.Modal returns false even though I'm
showing the form using its ShowDialog method.
Here's the conditional mentioned above, just to show the idea.
if (this.Modal)
{
this.ShowInTaskbar = false;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.SaveButton.Visible = false;
this.ChooseButton.DialogResult = DialogResult.OK;
foreach (Control ctrl in this.Controls)
ctrl.Left -= 72;
}
Thanks,
I'm working on a larger windows application in which I have a form that should
behave as an mdi-child or as a dialog depending on how it is diplayed. I thought
I'd display the form with ShowDialog() to get it modal and then at runtime check
for this.Modal in the form and set some properties.
This however, does not seem to work as this.Modal returns false even though I'm
showing the form using its ShowDialog method.
Here's the conditional mentioned above, just to show the idea.
if (this.Modal)
{
this.ShowInTaskbar = false;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.SaveButton.Visible = false;
this.ChooseButton.DialogResult = DialogResult.OK;
foreach (Control ctrl in this.Controls)
ctrl.Left -= 72;
}
Thanks,