2013-05-16 64 views
0

我有一個C#應用程序winForm。 表單包含顯示文件窗口文件系統的樹視圖。 我想添加一個選項,右鍵單擊打開Windows上下文菜單條的文件。 有一種方法來集成Windows菜單到我的C#應用​​程序?Windows資源管理器上下文菜單條

謝謝!

+0

(從現在我有代表回答這樣做的答案) 我會檢查接受的答案和最流行的答案(通過@Groky)在這個SO問題:http://stackoverflow.com/questions/451287 /怎麼辦 - 你秀-的窗口資源管理器上下文菜單,從-AC鋒利的應用 – panhandel

回答

0

一切皆有可能。

您首先必須在節點上點擊右鍵。

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

相關問題