【问题标题】:windows explorer context menu stripWindows 资源管理器上下文菜单条
【发布时间】:2013-05-16 19:06:32
【问题描述】:

我有一个 c# 应用程序 winForm。 该表单包含一个显示文件 windows 文件系统的树视图。 我想为右键单击打开 Windows 上下文菜单条的文件添加一个选项。 有没有办法将 windows 菜单集成到我的 c# 应用程序中?

谢谢!

【问题讨论】:

标签: c# .net winforms treeview


【解决方案1】:

一切皆有可能。

您首先必须在节点上单击鼠标右键。

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

在您使用上下文菜单的部分,您可以随心所欲地使用它(在这种情况下,我猜是让它出现在这个位置。)您应该阅读ContextMenuStrip Class 以获取更多信息。

【讨论】:

    猜你喜欢
    • 2011-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-03
    • 2020-12-26
    • 2010-12-22
    相关资源
    最近更新 更多