Talk2Tom11
Well-known member
I am having a little problem... I wrote a code to check if the computer is running windows xp, and if it is, then go through to the program, if not then give a messagebox error. But the problem is, if you are not running it, and wait a few seconds after the messagebox has been displayed, the main form will popup. here is my code
Code:
Private Sub Start_Check_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myKey As Microsoft.Win32.RegistryKey
Dim strLocation As String
Dim strKey As String
strLocation = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strKey = "ProductName"
myKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(strLocation)
If myKey.GetValue(strKey) = "Microsoft Windows XPh" Then
fL.ShowDialog(Me)
Else
MessageBox.Show("You are Running " & myKey.GetValue(strKey) & ". " & " You Must Run Windows XP or Higher", "Windows Version Check", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
End If
myKey.Close()
End Sub