vb.net mdi 子标题栏没有隐藏 [英] vb.net mdi child title bar not hiding

查看:27
本文介绍了vb.net mdi 子标题栏没有隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .NET 中的 mdi 父表单中隐藏处于最大化状态的 mdi 子表单的标题栏时遇到问题.

I have an issue hiding the title bar of a mdi child form in maximized state within a mdi parent form in .NET.

这是我在设计和运行:

这是我的 MDI 子表单的 new():

Here is the new() of my MDI child form:

Public Sub New(ByRef pParent As Form)
    MyBase.New()
    Me.MdiParent = pParent
    fParent = pParent
    Me.Text = ""
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.WindowState = FormWindowState.Normal
    Me.MinimizeBox = False
    Me.MaximizeBox = False
    Me.ControlBox = False
    Me.ShowIcon = False
    Me.ShowInTaskbar = False
    Me.SizeGripStyle = Windows.Forms.SizeGripStyle.Hide
    Me.Dock = DockStyle.Fill
End Sub

我已经尝试过 FormWindowState.MaximizedDockStyle.None 但结果是一样的.

I've tried FormWindowState.Maximized and DockStyle.None instead but the result was the same.

在父容器上,从一个子容器更改为另一个我使用这个函数:

On the parent container, to change from a child to another I use this function:

Protected Sub SetActiveScreen(ByVal pChildForm As tWizardForm)
    If pChildForm Is Nothing Then Exit Sub
    If fActiveScreen Is pChildForm Then Exit Sub

    Dim hg As New tHourglass
    Try
       fActiveScreen = pChildForm
       fActiveScreen.Show()
       fActiveScreen.BringToFront()
       For Each aForm In MdiChildren
          If aForm IsNot fActiveScreen Then aForm.Hide()
       Next
       fActiveScreen.Execute()
       UpdateCaption()
    Finally
       hg.Dispose()
    End Try    
End Sub

在设计时,我设置了父属性 IsMdiContainer = True.

At design I've set the parent property IsMdiContainer = True.

我哪里出错了或者我错过了什么?再加上子标题栏的这种双按钮真的很奇怪.当我单击最大化按钮之一时,我最终得到相同的结果:.

Where did I go wrong or what have I missed ? Plus this kind of double buttons on the child title bar is really strange. When I click one of the maximize buttons I end up with the same result: .

无法点击生成的标题栏按钮.

The resulting title bar buttons cannot be clicked.

感谢您的帮助!

推荐答案

这是您的确切答案.它将解决您的问题.

Here is your exact answer. It will solve your problem.

向 MDI 表单添加 MenuStrip 并使其不可见(Visible = false)

这篇关于vb.net mdi 子标题栏没有隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆