Microsoft KB Archive/322171

= FIX: When You Click a Maximized MDI Child Window Menu, the Adjacent Menu Appears =

Article ID: 322171

Article Last Modified on 10/11/2005

-

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.



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:

http://support.microsoft.com/contactus/?ws=support

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.



Steps to Reproduce the Behavior
The following steps use Visual C# as an example. Similar code in Visual Basic demonstrates the same problem.  Start a New Windows Application under Visual C# Projects.  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 {       ///         ///    Required designer variable. ///        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(&quot;&Window&quot;); miWindow.MenuItems.Add(&quot;&Cascade&quot;); miWindow.MenuItems.Add(&quot;Tile &Horizontal&quot;); miWindow.MenuItems.Add(&quot;Tile &Vertical&quot;); miWindow.MdiList = true ; // Adds the MDI Window List to the bottom of the menu.

//Add Help Menu MenuItem miHelp = mainMenu.MenuItems.Add(&quot;&Help&quot;); miHelp.MergeType = MenuMerge.MergeItems; miHelp.MergeOrder=0; miHelp.MenuItems.Add(&quot;&About&quot;);

Document doc = new Document; doc.MdiParent = this; doc.Show; }

///        ///    Clean up any resources being used. ///        protected override void Dispose(bool disposing) {           if (disposing) {               if (components != null) {                   components.Dispose; }           }            base.Dispose(disposing); }

///        ///    Required method for Designer support - do not modify ///   the contents of this method with the code editor. ///        protected void InitializeComponent {           this.components = new System.ComponentModel.Container ; this.mainMenu = new System.Windows.Forms.MainMenu ; this.Text = &quot;MDI Menu Bug&quot;; this.AutoScaleBaseSize = new System.Drawing.Size (5, 13); this.Menu = this.mainMenu; this.ClientSize = new System.Drawing.Size (450, 200); }

///        /// The main entry point for the application. ///        [STAThread] public static void Main(string[] args) {           Application.Run(new MainForm); }

} }                     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 {       ///         ///    Required designer variable. ///        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(&quot;&Help&quot;); miHelp.MergeType = MenuMerge.MergeItems; miHelp.MergeOrder=0; miHelp.MenuItems.Add(&quot;This Child Menu                                          should not appear when clicked on Window menu&quot;); }

///        ///    Clean up any resources being used. ///        protected override void Dispose(bool disposing) {           if (disposing) {               if (components != null) {                   components.Dispose; }           }            base.Dispose(disposing); }

///        ///    Required method for Designer support - do not modify ///   the contents of this method with the code editor. ///        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 = &quot;Child Window&quot;; this.ClientSize = new System.Drawing.Size(392, 117); this.Menu = mainMenu; this.WindowState = FormWindowState.Maximized; }   } }                     Run the application, and then click the Window menu. The Help menu appears.

Keywords: kbbug kbfix kbwindowsforms kbqfe kbnetframe100presp2fix kbnetframe100presp3fix kbhotfixserver KB322171

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.