emviruena
asked on
How change the font size in vb Menu application?
I am using VB for develop an application, and i want to know if is possible change the font size of my menu
You can by using the module 'modSysFonts' from http://www.thevbzone.com/modSysFonts.bas
and the following sample code (changes the font for the menu):
(answer also found on https://www.experts-exchange.com/questions/23674316/How-to-change-the-font-system-for-ative-title-bar-menu-message-box-in-VB-at-runtime.html)
and the following sample code (changes the font for the menu):
(answer also found on https://www.experts-exchange.com/questions/23674316/How-to-change-the-font-system-for-ative-title-bar-menu-message-box-in-VB-at-runtime.html)
Dim PreviousFont As StdFont
Dim NewFont As StdFont
' Get the previous font to be able to set it back to what it was before
If GetSysFontA(PreviousFont, Me.hDC, cf_Menu) = True Then
' Create a new font to set it to
Set NewFont = New StdFont
With NewFont
.Bold = False
.Italic = False
.Name = "Verdana"
.Size = 16
.Strikethrough = False
.Underline = False
End With
' Set the font to the newly created one
If SetSysFontA(NewFont, Me.hDC, cf_Menu) = False Then
MsgBox "ERROR"
Else
MsgBox "SUCESS!"
End If
' Restore the font to what it was before
SetSysFontA PreviousFont, Me.hDC, cf_Menu, True
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're right. The HookMenu is a better alternative.
http://forums.devx.com/sho