【发布时间】:2011-02-20 05:32:22
【问题描述】:
在我的 .NET 应用程序中,上下文菜单看起来像左边的。
如何在它们上应用 Windows 7 样式以使它们看起来像正确的样式?
【问题讨论】:
标签: .net winforms windows-7 contextmenu aero
在我的 .NET 应用程序中,上下文菜单看起来像左边的。
如何在它们上应用 Windows 7 样式以使它们看起来像正确的样式?
【问题讨论】:
标签: .net winforms windows-7 contextmenu aero
右击工具箱,选择项目。勾选“ContextMenu”,Namespace = System.Windows.Forms 和 Directory = Global Assembly Cache。
这个 .NET 1.x 组件与 ContextMenuStrip 不同,它使用本地 Windows 菜单。你会失去一些能力,我怀疑你在乎。您需要编写一行代码来分配菜单,设计器只允许您设置 ContextMenuStrip 属性。将该行添加到构造函数中,例如:
public Form1() {
InitializeComponent();
this.ContextMenu = contextMenu1;
}
【讨论】:
NotifyIcon 的ContextMenuStrip 属性,不支持ContextMenus。
notifyIcon.ContextMenu = contextMenu1
ToolStripMenuItem 控件一起使用吗?