FIX: When You Click a Maximized MDI Child Window Menu, the Adjacent Menu Appears (322171)



The information in this article applies to:

  • Microsoft .NET Framework 1.0

This article was previously published under Q322171

SYMPTOMS

If a multiple-document interface (MDI) child form with menus is maximized, and the MdiList property is set to True, when you click a MenuItem, the drop-down MenuItem next to it appears.

RESOLUTION

Cumulative Patch Information

To resolve this problem, obtain the Post-Service Pack 2 .NET Framework System.Data and WinForms Hotfix Package. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

328535 INFO: Post-Service Pack 2 .NET Framework System.Data and WinForms Hotfix Package

Hotfix Information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date          Time    Version        Size        File name
   -------------------------------------------------------------------------
   02-May-2002   19:48   1.0.3705.269   1,982,464   System.windows.forms.dll  
   02-May-2002   10:05                     16,696   System.windows.forms.ldo
   02-May-2002   10:00   1.0.3705.269      57,344   System.windows.forms.tlb
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

The following steps use Visual C# as an example. Similar code in Visual Basic demonstrates the same problem.
  1. Start a New Windows Application under Visual C# Projects.
  2. Open the code of Form1.cs, and then replace the existing contents with following sample code:
    namespace MDIMenu
    {
    	using System;
    	using System.ComponentModel;
    	using System.Drawing;
    	using System.Windows.Forms;
    
    	public class MainForm : System.Windows.Forms.Form 
    	{
    		/// <summary>
    		///    Required designer variable.
    		/// </summary>
    		private System.ComponentModel.Container components;
    		private System.Windows.Forms.MainMenu mainMenu;
    
    		public MainForm() 
    		{
    			// 
    			// Required for Windows Form Designer support
    			// 
    			InitializeComponent();
    
    			//Setup MDI stuff
    			this.IsMdiContainer = true;
    
    			//Add Window Menu
    			MenuItem miWindow = mainMenu.MenuItems.Add("&Window");
    			miWindow.MenuItems.Add("&Cascade");
    			miWindow.MenuItems.Add("Tile &Horizontal");
    			miWindow.MenuItems.Add("Tile &Vertical");
    			miWindow.MdiList = true ;
    			// Adds the MDI Window List to the bottom of the menu.
    
    			//Add Help Menu
    			MenuItem miHelp = mainMenu.MenuItems.Add("&Help");
    			miHelp.MergeType = MenuMerge.MergeItems;
    			miHelp.MergeOrder=0;
    			miHelp.MenuItems.Add("&About");
    
    			Document doc = new Document();
    			doc.MdiParent = this;
    			doc.Show();
    		}
    
    		/// <summary>
    		///    Clean up any resources being used.
    		/// </summary>
    		protected override void Dispose(bool disposing)
    		{
    			if (disposing) 
    			{
    				if (components != null) 
    				{
    					components.Dispose();
    				}
    			}
    			base.Dispose(disposing);
    		}
    
    
    		/// <summary>
    		///    Required method for Designer support - do not modify
    		///    the contents of this method with the code editor.
    		/// </summary>
    		protected void InitializeComponent()
    		{
    			this.components = new System.ComponentModel.Container ();
    			this.mainMenu = new System.Windows.Forms.MainMenu ();
    			this.Text = "MDI Menu Bug";
    			this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
    			this.Menu = this.mainMenu;
    			this.ClientSize = new System.Drawing.Size (450, 200);
    		}
    
    		/// <summary>
    		/// The main entry point for the application.
    		/// </summary>
    		[STAThread]
    		public static void Main(string[] args) 
    		{
    			Application.Run(new MainForm());
    		}
    
    	}
    }
    					
  3. Add a new Windows Form in the project. In the new form, replace the existing code with following sample code:
    namespace MDIMenu 
    {
    	using System;
    	using System.ComponentModel;
    	using System.Drawing;
    	using System.Drawing.Text;
    	using System.Windows.Forms;
    
    	public class Document : System.Windows.Forms.Form 
    	{
    		/// <summary>
    		///    Required designer variable.
    		/// </summary>
    		private System.ComponentModel.Container components;
    		private System.Windows.Forms.MainMenu mainMenu;
    
    		public Document() : base() 
    		{
    			// 
    			// Required for Windows Form Designer support.
    			// 
    			InitializeComponent();
    
    
    			//Add File Menu
    			MenuItem miHelp = mainMenu.MenuItems.Add("&Help");
    			miHelp.MergeType = MenuMerge.MergeItems;
    			miHelp.MergeOrder=0;
    			miHelp.MenuItems.Add("This Child Menu 
                                              should not appear when clicked on Window menu");
    		}
    
    		/// <summary>
    		///    Clean up any resources being used.
    		/// </summary>
    		protected override void Dispose(bool disposing)
    		{
    			if (disposing) 
    			{
    				if (components != null) 
    				{
    					components.Dispose();
    				}
    			}
    			base.Dispose(disposing);
    		}
    
    		/// <summary>
    		///    Required method for Designer support - do not modify
    		///    the contents of this method with the code editor.
    		/// </summary>
    		private void InitializeComponent()
    		{
    			this.components = new System.ComponentModel.Container();
    			this.mainMenu = new System.Windows.Forms.MainMenu();
    			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    			this.Text = "Child Window";
    			this.ClientSize = new System.Drawing.Size(392, 117);
    			this.Menu = mainMenu;
    			this.WindowState = FormWindowState.Maximized;
    		}
    	}
    }
    					
  4. Run the application, and then click the Window menu. The Help menu appears.

Modification Type:MinorLast Reviewed:10/11/2005
Keywords:kbHotfixServer kbQFE kbNetFrame100PreSP2fix kbNetFrame100preSP3fix kbbug kbfix kbQFE kbWindowsForms KB322171