简体   繁体   English

Windows资源管理器上下文菜单栏

[英]windows explorer context menu strip

I have ac# application winForm. 我有一个AC#应用程序winForm。 The form contain a tree view that show the file windows file system. 该表单包含一个树视图,该视图显示文件Windows文件系统。 I want to add an option for right click on file that open a windows context menu strip. 我想添加一个右键单击打开Windows上下文菜单栏的文件的选项。 There is a way to Integrate windows menu to my c# app? 有没有一种方法可以将Windows菜单集成到我的C#应用​​程序中?

Thank! 谢谢!

Everything is possible. 一切皆有可能。

You first have to catch a right click on a node. 您首先必须在节点上单击鼠标右键。

  private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) 
  {
    if (e.Button == MouseButtons.Right) 
    {
       treeView1.SelectedNode = e.Node;
       //Play with the context menu here.
    }
  }

On the part where you play with the context menu, you do what you want with it ( in this case make it appear at this location I guess..) You should read about the ContextMenuStrip Class for more information. 在使用上下文菜单播放的部分上,您可以根据需要进行操作(在这种情况下,我想让它显示在此位置。)您应该阅读ContextMenuStrip类,以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM