.NET MDI子表单抑制/隐藏标题/图标区域

发布于 2024-09-07 13:54:39 字数 426 浏览 0 评论 0原文

我有一个子表单(子表单),我想在多个父表单中使用它。我不是专业开发人员(我是建筑师 - 我知道,你可以保存所有笑话......:) - 目前单独工作)。我最终使用了带有子表单的 MDI 表单作为子表单。我最大化了子表单,大多数事情都很好,除了虽然我尝试禁用所有各种小部件(设计器中的子表单显示没有标题/图标/按钮区域),但我在左侧看到两个图标和两组右侧的按钮 - 其中只有恢复按钮起作用。任何一组按钮都适用于单子表单。

有什么办法解决这个问题吗?我希望子表单对用户“透明” - 他们不应该知道正在使用子表单。

我已经进行了快速搜索,并且已经抑制了另一个答案中提到的实际标题 - 为了在设计器中抑制标题栏...

MDI 是正确的技术吗?或者是否有更好的方法来实现相同的技术子窗体出现在多个父窗体中?

VS2008、C#、Windows 7

TIA、 保罗

I have a subform (child) that I want to use in a number of parents. I'm not a professional developer (I'm an architect - I know, you can save all the jokes... :) - working solo at present). I've ended up using an MDI form with the subform as a child. I maximize the subform form and most things are fine except that although I've tried to disable all the various widgets (the subform in the designer shows NO caption/icon/button area), I get TWO icons on the left and TWO sets of buttons on the right - of which ONLY the restore button works. Either of the sets of buttons will work the one child form.

Is there any way around this? I want the subform to be "transparent" the the user - they shouldn't be aware there's a subform in use.

I've done a quick search and I'd already suppressed the actual caption as mentioned in another answer - to get the caption bar suppressed in the designer...

Is MDI the right technology, or is there a better way to have the same subform appear in multiple parent forms?

VS2008, C#, Windows 7

TIA,
Paolo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羁客 2024-09-14 13:54:39

如果您在父级的构造函数中创建 MDI 子窗体,则存在一个 WF 错误,该错误将使字形加倍。下面是一个示例:

public partial class Form1 : Form {
    public Form1() {
        InitializeComponent();
        this.IsMdiContainer = true;
        var child = new Form();
        child.MdiParent = this;
        child.WindowState = FormWindowState.Maximized;
        child.Show();
    }
}

将子表单创建代码移至 Load 事件以避免这种情况。

There's a WF bug that will double the glyphs if you create the MDI child form in the parent's constructor. Here's an example:

public partial class Form1 : Form {
    public Form1() {
        InitializeComponent();
        this.IsMdiContainer = true;
        var child = new Form();
        child.MdiParent = this;
        child.WindowState = FormWindowState.Maximized;
        child.Show();
    }
}

Move the child form creation code to the Load event to avoid this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文