Solved

How to change the font of the menu items in vb.net

Posted on 2004-10-14
3
254 Views
Last Modified: 2013-12-03
I give up I searched the whole web but was not able to find an answer.

is there a good way to change the fonts of the menu header and menu items in windows forms by vb.net.
Please help?
0
Comment
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 12313073
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12316552
Yu need to Handle the DrawItem Event of all the MenuItems you need to change the Font for.

Write the Following Code on the DrawItem event of each MenuItem or in a Single method that Handles all the Menus DrawItem Event

        'get the Text To Draw
        Dim Txt As String = CType(sender, MenuItem).Text
        'Set The Font Color
        Dim MyBrush As System.Drawing.Brush = System.Drawing.Brushes.Black
        'Set The Font Name & Size
        Dim MyFont As New Font("Verdana", 10, GraphicsUnit.Pixel)
        'Draw The String
        e.Graphics.DrawString(Txt, MyFont, MyBrush, e.Bounds.X, e.Bounds.Y)

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now