Solved

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

Posted on 2004-10-14
3
293 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

679 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