Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8613091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:47:14+00:00 2026-06-12T04:47:14+00:00

I have a menu on my form that is defined as follows: private System.Windows.Forms.MainMenu

  • 0

I have a menu on my form that is defined as follows:

private System.Windows.Forms.MainMenu mainMenu1;

//Then

private void InitializeComponent()
{
 this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
 this.Menu = this.mainMenu1;
}

I set the font for the entire form, but the Menu items still ignore it. How do I make the font bigger for the Menu items? I can’t find Font property for the Menu or MenuItem….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:47:15+00:00Added an answer on June 12, 2026 at 4:47 am

    You can’t do it directly if you’re using a MainMenu. You should be using a MenuStrip instead.

    If you absolutely must use MainMenu, you have to set the OwnerDraw property of the MenuItem to true and override/implement the DrawItem and MeasureItem events so that you can manually paint it.


    Here’s a very basic custom menu item class; it’s by no means complete or fully functional, but it should get you started:

    using System.Windows.Forms;
    using System.Drawing;
    
    class CustomMenuItem : MenuItem
    {
        private Font _font;
        public Font Font
        {
            get
            {
                return _font;
            }
            set
            {
                _font = value;
            }
        }
    
        public CustomMenuItem()
        {
            this.OwnerDraw = true;
            this.Font = SystemFonts.DefaultFont;
        }
    
        public CustomMenuItem(string text)
            : this()
        {
            this.Text = text;
        }
    
        // ... Add other constructor overrides as needed
    
        protected override void OnMeasureItem(MeasureItemEventArgs e)
        {
            // I would've used a Graphics.FromHwnd(this.Handle) here instead,
            // but for some reason I always get an OutOfMemoryException,
            // so I've fallen back to TextRenderer
    
            var size = TextRenderer.MeasureText(this.Text, this.Font);
            e.ItemWidth = (int)size.Width;
            e.ItemHeight = (int)size.Height;
        }
    
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            e.DrawBackground();
            e.Graphics.DrawString(this.Text, this.Font, Brushes.Blue, e.Bounds);
        }
    }
    

    Here’s a 3-deep test usage:

    MainMenu mainMenu = new MainMenu();
    MenuItem menuFile = new CustomMenuItem("File");
    MenuItem menuOpen = new CustomMenuItem("Open");
    MenuItem menuNew = new CustomMenuItem("New");
    
    public MenuTestForm()
    {
        InitializeComponent();
    
        this.Menu = mainMenu;
        mainMenu.MenuItems.Add(menuFile);
        menuFile.MenuItems.Add(menuOpen);
        menuOpen.MenuItems.Add(menuNew);
    }
    

    And the output:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# Windows Form application that contains a menu with this event:
I have a mdicontainer form that summons forms. My problem is when the a
I have a menu item on my WPF form that runs an import routine,
I have a form that I want to show a drop-down menu that shows
I have an application with a form that has a main menu. Now I
I have a form that has a select menu(A) and 2 divs (B and
I have a Windows Form desktop CRUD application. The users are finding that if
I have a form that submits a jQuery .ajax event every time menu's value
I have a select menu in my form that I want to hide and
I have a nested form that has a select dropdown menu. How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.