如何更改菜单条的背景色 [英] how to change backcolor of menustrip

查看:549
本文介绍了如何更改菜单条的背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi朋友,当我单击菜单条下拉菜单项时,如何更改菜单条的背景颜色,但我想更改菜单条上的toolstripemenuitem1的颜色,我编写代码单击事件,但关闭后会更改背景色当我单击它时,拖放菜单未打开.
以及如何在我的鼠标位于该工具栏上时更改toolstripmenu项的颜色,以便默认情况下将其更改为垂直颜色,但是我想将其设置为我的自定义颜色,我该怎么做呢?我不得不在所有事件上使用click事件鼠标其他事件,但是当我的鼠标移到它上面时它不会改变,当我的鼠标离开它时它会改变,但是我想通过鼠标事件来改变它怎么办,请帮帮我.

hi friend how can I change the background color of menustrip when I click on menustrip dragdown items get opend but I want to change color of toolstripemenuitem1 which is at menue strip i write code to click event but it changes the back color after closing the dragdrop menu not on when i click on it.
and how to change color of toolstripmenu item when my mouse is over that toolstrip so that by default it get changed to a perticular color but i want to set it to my custome color how can i do it I had use click event mouse over event all other events but it not changing when my mouse is over it, it gets changed when my mouse left it but i want to change it over mouse event how to do it please help me. thanks.

推荐答案

,您需要创建一个自定义渲染器.这是Microsoft开发人员草草拼凑而成的几个组件之一;-)
请参见 ToolStrip,MenuStrip和StatusStrip控件的自定义呈现 [
you need to create a custom renderer. this is one of a few components hastily cobbled together by microsofts developers ;-)
see Custom Rendering for the ToolStrip, MenuStrip, and StatusStrip controls[^]


这篇关于如何更改菜单条的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆