is there a way to edit the menu to make it look like internet explorer's? In vb, the menus are poped in, making it looking kinda ugly. if you compare them, you will know what i'm talking about. I cant find any settings related to the menu at all
Printable View
is there a way to edit the menu to make it look like internet explorer's? In vb, the menus are poped in, making it looking kinda ugly. if you compare them, you will know what i'm talking about. I cant find any settings related to the menu at all
What effect are you looking for? How do they look in VB? Can you post screenshots?
Do you mean the fade effect when the menu opens? Or the toolbar part of the menu bar? Or what it looks like when you mouse-over it?
Can you please answer these so we can better help you?
Or are you talking about placing icons on the menus?
I'm not talking about icons, here:
http://www.vbforums.com/
http://www.makingaprofitonline.com/ie.jpg
do you see the difference? the one in vb looks ugly cause it's poped in (the menu toolbar)
Why don't you post some screen shots? So that we can understand better what exactly you are looking for?
You can have a Raised or Etched Menu line with this code:
This assumes that your Form Scalemode is VBTwips, if you are using VbPixels or some other, I think you could use ScaleX and ScaleY to fix coordinates.
VB Code:
Private Declare Function GetSysColor Lib "user32" _ (ByVal nIndex As Long) As Long Private Const COLOR_BTNFACE = 15 Private Const COLOR_BTNSHADOW = 16 Private Enum enuStyle Raised Etched End Enum Private Sub setMenuStyle(pStyle As enuStyle) Select Case pStyle Case Raised Me.Line (0, 15)-(ScaleWidth, 15), GetSysColor(COLOR_BTNSHADOW) Me.Line (0, 0)-(ScaleWidth, 0), vbWhite Case Etched Me.Line (0, 15)-(ScaleWidth, 15), vbWhite Me.Line (0, 0)-(ScaleWidth, 0), GetSysColor(COLOR_BTNSHADOW) End Select End Sub Private Sub Form_Load() setMenuStyle Etched End Sub Private Sub Form_Paint() setMenuStyle Etched 'Also here, so it works even when resizing End Sub
If you use a Toolbar, you don't need that code, since the Menu will look Etched (Toolbar Appearance must be = 0 [cc3D]).
If you also want to change the Menu color, you can use this code:
VB Code:
Option Explicit Private Const MIM_BACKGROUND As Long = &H2 Private Const MIM_APPLYTOSUBMENUS As Long = &H80000000 Private Type MENUINFO cbSize As Long fMask As Long dwStyle As Long cyMax As Long hbrBack As Long dwContextHelpID As Long dwMenuData As Long End Type Private Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Declare Function GetMenu Lib "user32" _ (ByVal hwnd As Long) As Long Private Declare Function SetMenuInfo Lib "user32" _ (ByVal hmenu As Long, _ mi As MENUINFO) As Long Private Declare Function CreateSolidBrush Lib "gdi32" _ (ByVal crColor As Long) As Long Private Declare Function OleTranslateColor Lib "olepro32.dll" _ (ByVal OLE_COLOR As Long, _ ByVal HPALETTE As Long, _ pccolorref As Long) As Long Private Function SetMenuColor(ByVal hwndfrm As Long, ByVal dwColour As Long, _ ByVal bIncludeSubmenus As Boolean) As Boolean Dim mi As MENUINFO Dim flags As Long Dim clrref As Long clrref = TranslateColor(dwColour) flags = MIM_BACKGROUND If bIncludeSubmenus Then flags = flags Or MIM_APPLYTOSUBMENUS End If With mi .cbSize = Len(mi) .fMask = flags .hbrBack = CreateSolidBrush(clrref) End With SetMenuInfo GetMenu(hwndfrm), mi DrawMenuBar hwndfrm End Function Private Function TranslateColor(ByVal dwOleColour As Long) As Long OleTranslateColor dwOleColour, 0, TranslateColor End Function Private Sub Form_Load() SetMenuColor Me.hwnd, RGB(200, 220, 200), True 'Some kind of Green End Sub
You can also get the "Internet Explorer Effect" by using this user control from vbAcceleartor.com.
You can download the demo project and the OCX (that you need to register) from the navigation bar on the left of the page. If you search the site for "toolbar" you will get a ton of info on that control and how to use it, but the sample project is probably the most helpful.