我们在我们的应用程序中遇到了以下问题:当我们打开一个 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 属性在显示屏幕子上设置为最大化。
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)
我希望这涵盖了更多的文档。
亲切的问候,
克里斯托夫