Prev: regex...
Next: MICRImage...
From: Ryan on
I have a form with one button. When button is clicked; it launched Notepad.exe.
The moment Notepad.exe is launched; I want to close my form (actually
application).
How do I do it?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim myProcess As System.Diagnostics.Process = New
System.Diagnostics.Process()
myProcess.StartInfo.FileName = "Notepad.exe"
myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
myProcess.Start()

End Sub

From: Chris Dunaway on
On Feb 11, 1:08 pm, Ryan <R...(a)discussions.microsoft.com> wrote:
> I have a form with one button. When button is clicked; it launched Notepad.exe.
> The moment Notepad.exe is launched; I want to close my form (actually
> application).
> How do I do it?
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Dim myProcess As System.Diagnostics.Process = New
> System.Diagnostics.Process()
> myProcess.StartInfo.FileName = "Notepad.exe"
> myProcess.StartInfo.WindowStyle =
> System.Diagnostics.ProcessWindowStyle.Normal
> myProcess.Start()
>
> End Sub

Did you try just closing your form? Me.Close()

If that doesn't work, then you can try Application.Exit()

Chris
 | 
Pages: 1
Prev: regex...
Next: MICRImage...