Hi all i hope this little code help some people.
This code is to make your program can't open 2 times so when you open your app and try to open it again a msgbox will pop up and wont let you open it again.
Dim CurrentProcesses() As Process Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs) CurrentProcesses = Process.GetProcessesByName _ (Process.GetCurrentProcess.ProcessName) If CurrentProcesses.GetUpperBound(0) <= 0 Then Exit Sub End If Dim XMsg As String = "Here is what ever you want the msgbox say." MessageBox.Show(XMsg, _ "Here is the Title of the MsgBox", _ MessageBoxButtons.OK, _ MessageBoxIcon.Error) End End Sub
i hope i help you