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 5951145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:29:42+00:00 2026-05-22T17:29:42+00:00

In an MDI application, when the MDI child form is maximised the icon for

  • 0

In an MDI application, when the MDI child form is maximised the icon for the form is used as the context menu icon, displayed on the left of the parent form’s MenuStrip. When I set the icon of a form used in an MDI application to something larger than 16×16 (I’m using 32×32) the icon is drawn unscaled, and the menu is resized to suit. Note that if the ICO file also contains a 16×16 version of the icon it works fine.

The following creates a basic application that shows the behaviour:

  • create a new solution and WinForms project
  • change Form1’s IsMdiContainer to true
  • add a MenuStrip to Form1
  • create a new form, call it MdiChildForm
  • set MdiChildForm‘s icon to a 32×32 ICO file, here’s one I prepared earlier
  • in Form1 add a menu item, double-click it to create the Click event handler and add the following:

    var child = new MdiChildForm();
    child.MdiParent = this;
    child.Show();
    child.WindowState = FormWindowState.Maximized;
    
  • build and run, click the menu item

Note that when you click the menu item again the icon changes to the default one, this is described in this question and isn’t the issue here.

I’m pretty sure this would be described as ‘by design’ but it is annoying nonetheless. Is there a way to force the context menu icon to scale down, sort of resizing the source icon? I’ll probably do that as well, but I’m after some kind of in-code catch-all.

  • 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-05-22T17:29:43+00:00Added an answer on May 22, 2026 at 5:29 pm

    Inspired by @Jeremy Thompson’s answer I found a possible workaround. I take the oversized icon, draw it to a new 16×16 bitmap, create a new icon from that, and assign it back to the child form. The new icon needs to be assigned prior to showing the form.

    This code is barely tested, and probably buggy and leaky, and I am not an expert on GDI so beware it may break stuff:

    var bmp = new Bitmap(16, 16);
    using (var g = Graphics.FromImage(bmp))
    {
        g.DrawImage(child.Icon.ToBitmap(), new Rectangle(0, 0, 16, 16));
    }
    var newIcon = Icon.FromHandle(bmp.GetHicon());
    child.Icon = newIcon;
    // ...
    child.Show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In .net MDI application the menu of child form automatically is merged to the
I made a simple application in which an MDI parent loads a child form
I have a .NET 3.5 MDI WinForms application. I set a a child form's
In MDI application which event can the child Form class use to detect when
I have a windows application with an MDI form and some child forms. I
The application is an MDI container app. A specific child form (Form1) when loaded
I have an mdi child form as a dockable content in my application and
My application looks like this: I have an MDI parent form - form1, the
I have a MDI parent form. When user presses Enter I want the Application
This is my MDI Parent. public partial class frmMain : Form { public Options

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.