If Problems

rosshodges

Active member
Joined
Nov 23, 2002
Messages
28
[VB] Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Label19.Text = "" Then MsgBox("Please enter Data")

If Label19.Text Then
Dim psInfo As New _
System.Diagnostics.ProcessStartInfo _
(Label19.Text)
psInfo.WindowStyle = _
System.Diagnostics.ProcessWindowStyle.Normal
Dim myProcess As Process = _
System.Diagnostics.Process.Start(psInfo)
End If
End Sub

[/VB]

Depending on the value of the label I would like it to do different things. If Label19.Text = "" it shows the error message as it should but then continues to do the 2nd part. How can I teminate it after it has displayed the error message? I have tried end if but this doesnt work?

Ross
 
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Label19.Text = "" Then
          MsgBox("Please enter Data")
        Else
          Dim psInfo As New _
          System.Diagnostics.ProcessStartInfo _
          (Label19.Text)
          psInfo.WindowStyle = _
             System.Diagnostics.ProcessWindowStyle.Normal
          Dim myProcess As Process = _
             System.Diagnostics.Process.Start(psInfo)
        End If
End Sub
 
Back
Top