0
如何獲得在IDE的標準菜單中找到的命令,該命令也出現在VS2005中的右鍵單擊上下文菜單中?如何讓命令出現在VS2005的右鍵菜單中?
如何獲得在IDE的標準菜單中找到的命令,該命令也出現在VS2005中的右鍵單擊上下文菜單中?如何讓命令出現在VS2005的右鍵菜單中?
我用這樣的事情如果它的任何幫助你:
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_application = (DTE2)application;
if (connectMode == ext_ConnectMode.ext_cm_Startup)
{
// Other command bars are: "Code Window", "ASPX Code Context"
var commandBar = _application.CommandBars["ASPX Context"];
CommandBarButton test =
commandBar.Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value, true) as CommandBarButton;
// Set the caption of the submenuitem
test.Caption = "Edit";
test.Enabled = true;
test.Visible = true;
test.Click += new _CommandBarButtonEvents_ClickEventHandler(MyEventHandler);
}
}