Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

790 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