Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have 5 programs that function well in vb editor. The menu strip contains 5 click events, Add,Edit,Find,Delete,Print. Each has its own form1, as well as its own exe file. I don't know how to code main menu tool strip click event to load and show any of the above programs. I was on several sites looking for a solution, but did not find any solution related to my problem.

What I have tried:

VB
Dim frm2 As New Form2
frm2.Show()

this will load a blank form2. When I assign a program name to form2, i.e. form2 = "NewMember.exe", the program stops because form2 cannot contain strings. I also tried MDIChild forms, but still could not load the form I wanted to update.
How do you assign a program name to form2 that will show the form requested. Newbie needs help. Thanks
Posted
Updated 23-Jun-22 8:58am
v3
Comments
matblue25 23-Jun-22 14:02pm    
There are a lot of unknowns here. What do the five programs do? Please describe. How do you want them to work when invoked from the form? You say you want "main menu tool strip" to "load" the programs. What does Form2 look like? You say it's a "blank form2" but it's a form that you created? We don't know what it looks like or what controls you have put in the form. Have you created a menu bar (menu strip) in it? If you have, you need to "load" the programs from the Click events of the menu strip items.

Either create a property or a constructor in the new Form: Transferring information between two forms, Part 1: Parent to Child[^] - the code is C#, but it's pretty obvious and Code Converter C# to VB and VB to C# – Telerik[^] can help if you don't understand it.
 
Share this answer
 
VB
Process.start("the_path_and_the_name_of_the_exe.exe")
 
Share this answer
 
You cannot assign a "program name" to a form. The form has no idea what to do with a "program name".

If you're trying to show an entire program, or application like Notepad, in your Form2 instance, you've got a lot more code to write.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900