mdi孩子没有显示最大化

时间:2013-05-14 10:29:23

标签: windows winforms mdi mdichild

我们在我们的应用程序中遇到以下问题:当我们打开一个mdi子窗体时,它会出现最大化的窗口状态,但它会以正常状态显示。来自父窗体的背景仍然可以在右侧和底部看到侧。

然而,当我将子窗体更改为正常状态并再次将其最大化时,它显示为最大化。但是当应用程序关闭并重新启动时,表单会再次出现问题。

任何人都可以帮我解决这个问题吗?

这是一个与Windows有关的问题吗?或其他什么?

Private Sub tbrMngr_ToolClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles tbrMngrCeres.ToolClick

    Try

        '--> Handle click '
        If Not e.Tool.SharedProps.Tag Is Nothing Then

            Select Case CType(e.Tool.SharedProps.Tag, String).ToUpper
                Case "M_MANAGEMENT" : HandleManagementClick(e.Tool.Key)
            End Select

        End If

    Catch ex As Exception
        MessageBox.Show(ex.Message)

这里是从菜单栏上的哪个按钮中选择的情况。所有问题都只出现在HandleManagementClick

 Private Sub HandleManagementClick(ByVal pstrKey As String)

    Try

        Dim lblnNonModal As Boolean = True

        If Not Me.ifrmActiveForm Is Nothing Then
            If Not ifrmActiveForm.Disposing Then
                ifrmActiveForm.WindowState = FormWindowState.Normal
                ifrmActiveForm.Dispose()
                ifrmActiveForm = Nothing
                iNotifiers = Nothing
            End If
        End If

        Me.Cursor = Cursors.AppStarting

        Select Case pstrKey.ToUpper
            Case "RES" : Me.ifrmActiveForm = New frmReservationWizard(Me.iclsApp, "RES")
            Case "RCAT" : Me.ifrmActiveForm = New frmFacilityCategory(Me.iclsApp, "RCAT")
            Case "RGRP" : Me.ifrmActiveForm = New frmFacilityGroup(Me.iclsApp, "RGRP")

        End Select

        If Not ifrmActiveForm Is Nothing Then
            If pstrKey.ToUpper.Equals("RES") Then
                'ifrmActiveForm.ShowInTaskbar = False
                ifrmActiveForm.ShowDialog()
                ' Me.ShowScreen(FormWindowState.Normal, False, lblnNonModal, FormStartPosition.CenterScreen)
                ifrmActiveForm.Dispose()
            Else
                Me.ShowScreen(FormWindowState.Maximized, False, lblnNonModal, FormStartPosition.CenterScreen)

            End If
        End If

    Catch ex As Exception
        MessageBox.Show(ex.Message)

如您所见,windowstate属性在showscreen sub上设置为最大化。

 Private Function ShowScreen(ByVal pWindowState As FormWindowState, _
                            ByVal pblnRegisterChild As Boolean, _
                            ByVal pblnIsMdiChild As Boolean, _
                            ByVal pStartPosition As FormStartPosition) As DialogResult

    Dim lDialResult As DialogResult = DialogResult.None
    Dim lblnOpeningScreen As Boolean

    Try

        If Not lblnOpeningScreen Then

            lblnOpeningScreen = True

            Me.iNotifiers = Nothing

            If pblnIsMdiChild Then

                If pblnRegisterChild Then RegisterChild(AddressOf ifrmActiveForm.ParentNotifier)

                ifrmActiveForm.WindowState = pWindowState
                ifrmActiveForm.MdiParent = Me
                ifrmActiveForm.Show()

            Else
                lDialResult = ifrmActiveForm.ShowDialog()
            End If

        End If

        Return lDialResult

    Catch ex As Exception
        MessageBox.Show(ex.Message)

我希望这包含更多文档。

亲切的问候,

克里斯托夫

0 个答案:

没有答案
相关问题