|
-
Mar 8th, 2007, 04:41 PM
#1
Thread Starter
New Member
Launching an external EXE and Hiding a button
I am pretty new to Visual Basic and I started working with .NET 2005 Express Edition and found that for such a program to run the system must have .NET FW 2.0 installed on it. My application may not necessarily be run on a system that already has FW 2.0 installed on it, so my option is to use VB6, thus eliminating the dependancy on any FW version being installed. This is just a simple program that will be placed on a DVD and autorun when the DVD is inserted in the ODD. This program should launch, determine which buttons to display and based on what button the user clicks what it should do. There is a Cancel Button on it that I have already figured out how to code, but I am running in to problems with the buttons that will launch a seperate progam when clicked, and with determinaning what buttons should be displayed when the program runs. Below is the code that I was able to successfully create that requires FW 2.0 to be installed. I would like to know if anyone knows what changes it takes to port this back to VB6?
Upon loading the form I need it to check if the OS is VISTA and if so it needs to hide Button2. I have the form created with all the buttons, I just need the correct code for the buttons and the form load.
Any assistance would be greatly appreciated.
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
Dim a As New ProcessStartInfo("APP1\setup.exe")
Process.Start(a)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
Dim a As New ProcessStartInfo("APP2\setup.exe")
Process.Start(a)
End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If ((System.Environment.OSVersion.Platform = PlatformID.Win32NT) AndAlso (System.Environment.OSVersion.Version.Major = 6)) Then
'Vista
Me.Button1.Visible = False
End If
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|