On Sep 22, 9:21*am, Onur Güzel <kimiraikkone...@gmail.com> wrote:
> On Sep 22, 3:44*pm, Joe Duchtel <duch...@gmail.com> wrote:
>
> > On Sep 21, 5:47*pm, Armin Zingler <az.nos...@freenet.de> wrote:
> > Hello Onur -
>
> > I tried your suggestion to just output a MsgBox() and it popped up
> > with the form still showing. *How is that a FormClosed if I can still
> > see it? *I also need to access a .Checked of a menu item before I call
> > the System.Diagnostics.Process.Start("shutdown", "-l"). *Is it safe to
> > access that if the form is truly closed?
>
> > Thanks!
> > Joe- Hide quoted text -
>
> Joe,
> You did "not" mention that you'll output a MsgBox() but run shutdown
> command. If you show a MsgBox on FormClosed event, MsgBox and the
> caller form will remain alive for user input in order to return a
> MessageBoxResult to the caller because of being "modal". After you
> click something on MsgBox, form is closed and rest of the code is
> executed. When i try with process.start, (eg: launch notepad.exe) on
> formclosed event, form is closed and process is launched perfectly
> fine, in that case you need to try "shudown -l" command on formclosed
> event.
>
> Besides that, you can try thread.sleep before launching "shutdown"
> command to let app take a breath.
>
> HTH,
>
> Onur Güzel
Hello -
I only put the MsgBox() in there to see what is happening when timing-
wise. Makes sense that the form stays alive while showing it. I'll
just put the System.Diagnostics.Process.Start("shutdown", "-l") in
there.
Thanks!
Joe
|