I have a “main” form (form1).
Within that form I successfully open another form (form2) – but – when that form is open, you can still control the underlying form (form1).
I don’t want the user to be able to do so, and whenever he tries to click on it or something, the popped-up form (form2) should gain focus/flash a bit, with some default Windows sound.
I’ve just described how it acts if the popup window is a FileSave/OpenDialog. Those dialogs work exactly as I want them to work.
I’ve tried setting form2.Owner = form1; but that did not result in the desired effect.
So my question basically is: how can I get the same effect of focus/etc. on a form – just how it is on a Save/OpenDialog?
Thanks,
~ Tgys
To open the
form2useform2.ShowDialog()In
form1classThis way form1 will remain in the background and un-clickable until form2 is shown. You can also return the dialog result from form2 if you want. Code from MSDN.