|
-
Dec 10th, 2005, 02:08 AM
#1
Thread Starter
Hyperactive Member
menu
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
-
Dec 10th, 2005, 03:34 AM
#2
Re: menu
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?
-
Dec 10th, 2005, 03:41 AM
#3
Re: menu
Or are you talking about placing icons on the menus?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 10th, 2005, 04:17 AM
#4
Thread Starter
Hyperactive Member
Re: menu
I'm not talking about icons, here:
do you see the difference? the one in vb looks ugly cause it's poped in (the menu toolbar)
-
Dec 10th, 2005, 04:31 AM
#5
Re: menu
Why don't you post some screen shots? So that we can understand better what exactly you are looking for?
-
Dec 10th, 2005, 05:35 AM
#6
Re: menu
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
Last edited by jcis; Dec 10th, 2005 at 05:51 AM.
-
Dec 10th, 2005, 01:09 PM
#7
Re: menu
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.
Last edited by eyeRmonkey; Dec 10th, 2005 at 01:32 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|