如果多文档界面 (MDI) 子窗体与菜单处于最大化状态,并
MdiList 属性设置为
True,当您单击它旁边的下拉列表
菜单项 将显示一个
菜单项 中。
累积修补程序信息
若要解决此问题,获得 Post-Service 包 2.net Framework System.Data 和 WinForms 修补程序包。有关更多的信息请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
328535
(http://support.microsoft.com/kb/328535/EN-US/
)
信息: Post-Service 包 2.net Framework System.Data 和 WinForms 修补程序包
修复程序信息
现在提供 Microsoft,受支持的修复程序,但它只用于解决本文所述的问题。仅将它应用于出现这一特定问题的系统。此修补程序可能还会接受进一步的测试。因此,如果此问题没有对您造成严重的影响,我们建议您等待包含此修复程序在下一个.net 服务包。
要立即解决此问题,请与 Microsoft 产品支持服务以获取此修复程序。有关 Microsoft 产品支持服务电话号码和关于支持费用的信息的完整列表,请访问下面的 Microsoft 网站:
注: 在特殊的情况通常会导致支持电话的费用可能会被取消如果 Microsoft 支持专业人员确定某个特定更新才能解决您的问题。将正常收取支持费用将应用于其他支持问题和不需要进行专门更新的问题。
此修复程序的英文版具有文件属性 (或更高版本) 下表中列出。其格式为协调通用时间 (UTC) 列出日期和时间对这些文件。当您查看文件信息时,将转换为本地时间。若要 UTC 与本地时间之间的时差使用控制面板中的日期和时间工具中的
时区 选项卡。
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
Microsoft 已经确认这是在本文开头列出的 Microsoft 产品中的问题。
重现行为的步骤
下列步骤将使用 Visual C# 作为示例。在 Visual Basic 中类似的代码演示了同样的问题。
- 启动在 Visual C# 项目 下一个 新的 Windows 应用程序。
- 打开的 Form1.cs,的代码,然后替换现有的内容后面的代码示例:
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());
}
}
}
- 在 $ 项目中添加 新的 Windows 窗体。新窗体中现有代码替换下面的代码示例:
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;
}
}
}
- 运行在的应用程序,然后单击 窗口 菜单。此时将显示 帮助 菜单。
文章编号: 322171 - 最后修改: 2005年10月11日 - 修订: 3.4
这篇文章中的信息适用于:
- Microsoft .NET Framework 1.0
| kbmt kbhotfixserver kbqfe kbnetframe100presp2fix kbnetframe100presp3fix kbbug kbfix kbqfe kbwindowsforms KB322171 KbMtzh |
机器翻译注意:这篇文章是由无人工介入的微软自动的机器翻译软件翻译完成。微软很高兴能同时提供给您由人工翻译的和由机器翻译的文章, 以使您能使用您的语言访问所有的知识库文章。然而由机器翻译的文章并不总是完美的。它可能存在词汇,语法或文法的问题,就像是一个外国人在说中文时总是可能犯这样的错误。虽然我们经常升级机器翻译软件以提高翻译质量,但是我们不保证机器翻译的正确度,也不对由于内容的误译或者客户对它的错误使用所引起的任何直接的, 或间接的可能的问题负责。
点击这里察看该文章的英文版:
322171
(http://support.microsoft.com/kb/322171/en-us/
)
Microsoft和/或其各供应商对于为任何目的而在本服务器上发布的文件及有关图形所含信息的适用性,不作任何声明。 所有该等文件及有关图形均"依样"提供,而不带任何性质的保证。Microsoft和/或其各供应商特此声明,对所有与该等信息有关的保证和条件不负任何责任,该等保证和条件包括关于适销性、符合特定用途、所有权和非侵权的所有默示保证和条件。在任何情况下,在由于使用或运行本服务器上的信息所引起的或与该等使用或运行有关的诉讼中,Microsoft和/或其各供应商就因丧失使用、数据或利润所导致的任何特别的、间接的、衍生性的损害或任何因使用而丧失所导致的之损害、数据或利润不负任何责任。