Hello all!
I come from a PHP background which I have found to be quite similar to VB. I am having a little trouble using an Else If statement though, I'm just messing around trying to get to grips with it all right now. Here is the trouble I'm having:
Basically, if notepad is running, when the button is pressed it displays a popup saying "Process is running", all I want to do is display a popup saying "Process isn't running" if it isnt, now, I thought this would be the most simple part of it all, this is what I expected to write:
If notepad is running I get the "Process is running" popup followed by an infinite number of "Process isn't running" popup boxes, if notepad isnt running I just get the infinite "Process isn't running" popups. I have tried a few various things but cant get my head around this! I know it should be quite simple!
Do i have to set a new if statement? such as
Any help would be much appreciated!
Tom.
I come from a PHP background which I have found to be quite similar to VB. I am having a little trouble using an Else If statement though, I'm just messing around trying to get to grips with it all right now. Here is the trouble I'm having:
Code:
For Each proc As Process In Process.GetProcesses
If proc.ProcessName = "notepad" Then
MsgBox("Process is running")
End If
NextCode:
For Each proc As Process In Process.GetProcesses
If proc.ProcessName = "notepad" Then
MsgBox("Process is running")
Else
MsgBox("Process isn't running")
End If
NextDo i have to set a new if statement? such as
Code:
For Each proc As Process In Process.GetProcesses
If proc.ProcessName = "notepad" Then
MsgBox("Process is running")
ElseIf XXX Then
MsgBox("Process isn't running")
End If
NextTom.