开发者

Making WinForm ContextMenu Background Gray?

Context menus seem to have a default white background.

This looks pre开发者_如何转开发tty nice, but for consistency's sake, I'd like the context menu to be gray like with any other application. How can I get this style for my context menu?


Have a look at my answer for another similar question about menu items.

What you need to do is to use a ContextMenu instead of a ContextMenuStrip. This will pick up the default colours (ie. gray) and styles set in the underlying operating system instead of its own defined colours and styles.


contextMenuStrip1.BackColor = Color.Pink;

Put that in the onLoad handler, or go to the properties and change the BackColor there :o)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜