Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I added 2 existing projects to my current project..now i want to call each of them on button click event..
please tell me how to do that

Thank you
Posted
Comments
aliwpf 4-Mar-13 8:32am    
what do you need exactly?
[no name] 4-Mar-13 8:45am    
i added one barcode application to my wpf application.the barcode is in c#.now in wpf interface if i want to call that project(or form) how to call that
[no name] 4-Mar-13 8:56am    
Look at the System.Diagnostics.Process class

Your WPF application should be the startup project, and make the output of the 2nd project be a class library (DLL). You can then add that DLL as a reference to your WPF project and call it.
 
Share this answer
 
VB
Dim Process As New Process
Dim ProcessProperties As New ProcessStartInfo
ProcessProperties.FileName = "C:\Users\VEKATRAMAN\VB2.exe"
ProcessProperties.Arguments = ""
ProcessProperties.WindowStyle = ProcessWindowStyle.Maximized
Dim myProcess As Process = Process.Start(ProcessProperties)
myProcess.WaitForExit()

Console.WriteLine("C:\Users\......\(->Ur Process to call<-).exe: " & myProcess.ExitTime & Environment.NewLine & "Exit Code: " & myProcess.ExitCode)


This codeset when inserted in to a Button click event,will call the project you want.Code the path corretly.It will directly call the .exe file.Any number of processes can be called.
regards and blessings,
Happy coding,
Venkatraman/kvinvisibleguy
age-68 ++
 
Share this answer
 
Dim frm As Window
frm = New Window2
frm.Show()
 
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