如何通过单击按钮调用项目 [英] How to call a project on a button click

查看:70
本文介绍了如何通过单击按钮调用项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我在当前项目中添加了2个现有项目..现在我想在按钮点击事件中调用每个项目..

请告诉我该怎么做



谢谢

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

推荐答案

你的WPF应用程序应该是启动项目,并使第二个项目的输出成为类库(DLL)。然后,您可以将该DLL添加为WPF项目的引用并调用它。
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.


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)





插入Button单击事件时,此代码集将调用您想要的项目。相应地编码路径。它将直接调用.exe文件。可以调用任意数量的进程。

问候和祝福,

快乐编码,

Venkatraman / kvinvisibleguy

age-68 ++


Dim frm As Window

frm = New Window2

frm.Show()
Dim frm As Window
frm = New Window2
frm.Show()


这篇关于如何通过单击按钮调用项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆