MDI Form issue VB:NET

落花浮王杯 提交于 2019-12-12 02:45:41

问题


Hy today i have some problems with the Panel Control and MDI Child Forms, My problem is that I can not set the panel control to back of child forms. My head is spinning trying to solve this problem.


回答1:


It looks like you added your Panel to your ParentForm, doing so will keep on top. You need to Assign it to a ChildForm. One of your other options would be to create a dockable panel and dock it on the side of your parent.

Take a look at these articles

  1. http://bytes.com/topic/visual-basic-net/answers/382474-how-do-you-bring-mdi-child-windows-front-if-mdi-parent-has-controls
  2. http://social.msdn.microsoft.com/Forums/en-AU/winforms/thread/a9682277-d612-41e8-b5c0-44434b0bcb22

Based on your comment you can do something like this with a Timer set for 100ms

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
    Panel1.Visible = CheckForMDIChildren()
End Sub

Private Function CheckForMDIChildren() As Boolean
    If Me.MdiChildren.Count > 0 Then
        For Each frm As Form In Me.MdiChildren
            If frm.Visible Then Return False
        Next
    End If
    Return True
End Function


来源:https://stackoverflow.com/questions/12889808/mdi-form-issue-vbnet

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!