本文介绍了如何更改工具栏菜单的悬停颜色? VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想更改工具栏菜单(按钮)的悬停颜色,即您将鼠标悬停在按钮上时看到的背景颜色,是否有必要更改?我已经尝试过mousehover,mouseleave等,但这没用

Hey guys, i wanna change the hover color of a toolstrip menu ( button ) , the back color that you see when you hover it with the button, is there anyway to change? i've tried mousehover, mouseleave, etc. but it didn't work

谢谢

推荐答案

谢谢

这两个潜艇似乎为我做到了:

These two subs seem to do it for me:

    Private Sub AddToIgnoreListToolStripMenuItem_MouseHover(sender As Object, e As EventArgs) Handles AddToIgnoreListToolStripMenuItem.MouseHover
        Dim mi As ToolStripMenuItem = DirectCast(sender, ToolStripMenuItem)
        mi.BackColor = Color.Black
        mi.ForeColor = Color.White
    End Sub
    Private Sub AddToIgnoreListToolStripMenuItem_MouseLeave(sender As Object, e As EventArgs) Handles AddToIgnoreListToolStripMenuItem.MouseLeave
        Dim mi As ToolStripMenuItem = DirectCast(sender, ToolStripMenuItem)
        mi.BackColor = Color.FromKnownColor(KnownColor.ControlLightLight)
        mi.ForeColor = Color.Black
    End Sub


这篇关于如何更改工具栏菜单的悬停颜色? VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 22:01