Re: Modal dialog from .cs file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Jamie,

It works for me. Can you post an example of where calling ShowDialog
doesn't make the form modal?


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"jamie" <no@xxxxxxx> wrote in message
news:CMmef.1512$w84.318753@xxxxxxxxxxxxxxxxxxxxxxxx
>I have a class that based on a timer will pop up a dialog based on a lasped
>amount of time.
>
> The problem is that in the timer elapsed event I create and use ShowDialog
> to show the timeout form:
> frmTimeout dlg = new frmTimeout();
> dlg.ShowDialog(dlgOwner); <-- dlgOwner if the IWin32Window of the window
> in focus
>
>
> When the dialog opens, it is not modal. I've tried passing the
> IWin32Window of the dlg in focus, just using ShowDialog() but no luck.
>
> Is there a way to open this dialog from code and have it truely modal?
> (I don't want to use the AlwaysOnTop flag).
>
> thanks,
>
> Jamie


.



Relevant Pages

  • Re: showdialog ; is there a property showing it?
    ... > the instance of form 3, opens itself as showdialog, and displays some data ... If you are calling a form's 'Show' or 'ShowDialog' method twice on the ... Herfried K. Wagner ...
    (microsoft.public.dotnet.languages.vb)
  • Re: cannot keep form topmost
    ... when you call the child forms, are you using form.show or form.showdialog? ... showdialog makes the form modal, that will keep it on top, but limit your ... > I have a parentform which opens another form, ... > Please help as I want it to stay ontop forever until i want to close it. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: cannot keep form topmost
    ... it gives me compile error. ... > showdialog makes the form modal, that will keep it on top, but limit your ... >> I have a parentform which opens another form, ... >> Please help as I want it to stay ontop forever until i want to close it. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MDIForms with log-ins
    ... Create a form that you opens with showdialog in the load ... event of the MDIForm the last will not show up when you close it direct in ...
    (microsoft.public.dotnet.languages.vb)