Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

 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

 

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

"Drink wet cement and get really stoned"
  • *Experts*
Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...