I have VB6 program and I have make it as executable *.exe files. How I can showed the VB6 form when I click the executable file?My path location of my vb6 is C:\Project\PF.exe. I know we can call the execuatable files using shell method, when I used it, it show my the form1 when I click the button because while make the executables files, I make form1 as start up. I trying to make a short cut by calling the form3
Just add command line parameters to the program which specify the form to show. You can then use these parameters in a shortcut or via the Shell command.
That screen does not affect the program at all. It is just for testing inside VB itself - if you put form2 in there, it is the same as running C:\cuba\Project1.exe form2
You need to add code to read the command line (Command), and perform whatever actions you want based on it - as shown in the article.
Ok.. I try to give a try with run command on my computer.. My start up object for executable files is "FORM1" . So I call it using run command like this
C:\cuba\Project1.exe form2.. But not working.. It still show form1 form.. Why? Something wrong string I insert in the run command?
Not sure if this is what you're after, but I'll give it a try.
Code:
Private Sub Form_Load()
Select Case Command
Case "Form1" ' It was run like "C:/MyApp.exe Form1"
Form1.Show
Case "Form2" ' It was run like "C:/MyApp.exe Form2"
Form2.Show
Unload Me
Case Else 'It was run with with something else in command line, so it shows Form1 and a popup
MsgBox "Unknown Command!"
End Select
End Sub
Last edited by Teseng; Jun 12th, 2008 at 10:47 AM.