没必要用第三方控件,用API函数就可以实现:
Private Enum MENUINFO_STYLES
MNS_NOCHECK = &H80000000
MNS_MODELESS = &H40000000
MNS_DRAGDROP = &H20000000
MNS_AUTODISMISS = &H10000000
MNS_NOTIFYBYPOS = &H8000000
MNS_CHECKORBMP = &H4000000
End Enum
Private Enum MENUINFO_MASKS
MIM_MAXHEIGHT = &H1
MIM_BACKGROUND = &H2
MIM_HELPID = &H4
MIM_MENUDATA = &H8
MIM_STYLE = &H10
MIM_APPLYTOSUBMENUS = &H80000000
End Enum
Private Type MENUINFO
cbSize As Long
fMask As MENUINFO_MASKS
dwStyle As MENUINFO_STYLES
cyMax As Long
hbrBack As Long
dwContextHelpID As Long
dwMenuData As Long
End Type
Private Declare Function GetMenuInfo Lib "user32" (ByVal hMenu As Long, mi As MENUINFO) As Long
Private Declare Function SetMenuInfo Lib "user32" (ByVal hMenu As Long, mi As MENUINFO) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Sub Form_Load()
Dim MyMenu As MENUINFO
MyMenu.cbSize = Len(MyMenu)
MyMenu.fMask = MIM_BACKGROUND Or MIM_APPLYTOSUBMENUS
MyMenu.hbrBack = CreateSolidBrush(vbRed)
SetMenuInfo GetMenu(Me.hwnd), MyMenu