True Modal Dialog

  • Thread starter Thread starter Jennifer N.
  • Start date Start date
J

Jennifer N.

I've seen many posts and possilbe solutions to having true modal
dialog behavior - but none are working for me. Is there a sure-fire
way to make it work?

When I take the steps to have my parent window hide while the child is
up, I cannot get the parent window to re-display when the child goes
away. It is always minimized in the task bar.

Here's a code snippet - it's pretty simple. ControlButtonsForm is
the child window.

ControlButtonsForm cBForm = new ControlButtonsForm();
this.Visible = false;
cBForm.ShowDialog();
this.Visible = true;
this.Show();
this.BringToFront();
this.Focus();
// I am still minimized!!!!!!!!

As you can see, I've tried anything I thought would work.

Any ideas?
Thanks,
Jennifer.
 
Jen:

If you set the FormBorderStyle fo the Dialog Form to FixedDialog for
instance, and say on the OK button, just use this line me.DialogResult =
DialogResult.Ok (or whatever one you want with each button) this is all you
need from the calling form :
Dim f As New FormYouWantToBeTheDialog

f.ShowDialog()
 
Back
Top