You can't directly, but you can make a picture with the font on it..
VB Code:
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
With this little app you can add pictures to menu items. You can change the Form font and fontsize to what ever you want and this will change the menu font and fontsize.
Last edited by Keithuk; Dec 25th, 2006 at 06:48 PM.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Thanks for this mate it was exactly what I was searching for and it works perfectly but we cannot use CheckBoxes on the menu any longer, does anyone know how to make them working again as it is necessary to me?
Cool_Menu still works, but in Windows 7 I initially received the following error:
"Line 28: Class MSComctlLib.ImageList of control ImageList was not a loaded control class."
I believe this is because Component MSCOMCTL.OCX is not not registered.
I resolved this problem by running the following in elevated Command Prompt window:
cd C:\Windows\SysWOW64\
regtlib msdatsrc.tlb