|
-
Jan 13th, 2006, 02:04 AM
#41
PowerPoster
Re: Change Menu color?
i even tried to change the value of the const but it didnt like the RGB at all and couldnt figure out how to change it to HEX. a search on VBF gave me no luck.
Complete project attached.
username/password: test
wouldnt let me attach: file too large.
can download project here:
-
Jan 13th, 2006, 02:17 AM
#42
Re: Change Menu color?
Havent finished but giot the menu bar to draw correctly but not the submenus.
VB Code:
Dim mi As MENUINFO
With mi
.cbSize = Len(mi)
.fMask = MIM_BACKGROUND
.hbrBack = CreateSolidBrush(vbRed) 'RGB(111, 140, 223)
SetMenuInfo GetMenu(Me.hWnd), mi 'main menu bar
.fMask = MIM_BACKGROUND Or MIM_APPLYTOSUBMENUS
.hbrBack = CreateSolidBrush(vbRed) 'RGB(111, 140, 223)
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 0), mi 'File menu (item 0)
.hbrBack = CreateSolidBrush(vbRed) 'RGB(111, 140, 223)
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 1), mi 'Add menu (item 1)
.hbrBack = CreateSolidBrush(vbRed) 'RGB(111, 140, 223)
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 2), mi 'View menu (item 2)
.hbrBack = CreateSolidBrush(vbRed) 'RGB(111, 140, 223)
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 3), mi 'Settings menu (item 3)
' .hbrBack = CreateSolidBrush(RGB(111, 140, 223))
End With
DrawMenuBar Me.hWnd
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 
-
Oct 15th, 2008, 02:49 AM
#43
Addicted Member
Re: Change Menu color?
the code is still useful in year 2008, thank you.
I want to ask a question:
I have a menu with four items : File, Edit, Tools, Help.
Can I just make the menu bar "Help" in red color while the others three menu items (that is, File, Edit and Tools) remains default grey color.
Thank you a lo
-
Feb 14th, 2010, 02:55 PM
#44
Lively Member
Re: Change Menu color?
it doesnt work if the menu is invisible! I like to hide the main menu and use the menu in a ownerdrawn menu
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
|