Treeview节点-运行外部应用程序 [英] Treeview Node - Run External Application

查看:90
本文介绍了Treeview节点-运行外部应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个关于Treeview控件的快速问题.我有一个带有1个主节点和3个子节点的Treeview控件的项目.当用户选择子节点时,我希望它们运行外部程序.

如何使选定的子节点运行某些应用程序.

Hi All,

I have a quick Question regarding treeview control. I have a project with a Treeview control with 1 main node and 3 child nodes. When a user selects the child nodes, i want them to run an external program.

How can i make a selected child node run certain application.

+Programs
    +Notepad     (process.start("notepad.exe"))
    +MS Paint    (process.start("mspaint.exe"))
    +Calculator  (process.start("calculator.exe"))






任何帮助都太棒了!

干杯






Any Help would be fantastic!

Cheers

推荐答案

好像您已经知道 ^ ]允许您从程序中执行任何可执行文件.

现在,在节点单击上,您可以使用开关盒.在其中,基于节点文本(或任何其他标识符),使用Process.Start并启动所需的应用程序.
Looks like you already know that Process.Start[^] allows you to execute any executable from within your program.

Now, On node click, you can use a switch case. In it, based on the node text (or any other identifier), use Process.Start and launch the desired application.


这篇关于Treeview节点-运行外部应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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