更改鼠标悬停的颜色 [英] change the color of mouse hover

查看:108
本文介绍了更改鼠标悬停的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C# 使用Visual Studio 2008.我想了解当用户将鼠标悬停在菜单栏项上时如何更改ToolStripMenuItem.BackColor.我尝试在MouseHover事件中更改BackColor属性,但没有任何变化.我将不胜感激您可能拥有的任何解决方案.

I’m working with Visual Studio 2008 using C#. I would like to find out how to change the ToolStripMenuItem.BackColor when the user hovers over a menustrip item. I’ve tried changing the BackColor property in the MouseHover event but nothing changes. I would appreciate any solutions that you might have.

推荐答案

您可以使用mouseenter事件和mouseleave事件来代替mousehover事件.
you use mouseenter event and mouseleave event in place of mousehover event.


在将ToolStripMenuItem集中到该时间窗口时,选择该ToolStripMenuItem的整个区域,这就是为什么您看不到底色的原因.
When you focusing the ToolStripMenuItem that time windows selecting the full region of that ToolStripMenuItem thats why back color is not visible for you.


这篇关于更改鼠标悬停的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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