1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Private Sub Form1_Move(sender As Object, e As System.EventArgs) Handles Me.Move
Dim form As Form = DirectCast(sender, Form)
Dim sS As StatusStrip = DirectCast(MDIParent1.StatusStrip, StatusStrip)
Dim mS As MenuStrip = DirectCast(MDIParent1.MenuStrip1, MenuStrip)
Dim tS As ToolStrip = DirectCast(MDIParent1.ToolStrip1, ToolStrip)
If (Left < MdiParent.DisplayRectangle.Left) Then
Left = MdiParent.DisplayRectangle.Left
End If
If (Top < MdiParent.DisplayRectangle.Top) Then
Top = MdiParent.DisplayRectangle.Top
End If
If (Top + Height > MdiParent.DisplayRectangle.Top + MdiParent.DisplayRectangle.Height - sS.Height - mS.Size.Height - tS.Size.Height) Then
Top = MdiParent.DisplayRectangle.Top + MdiParent.DisplayRectangle.Height - Height - sS.Height - mS.Size.Height - tS.Size.Height
End If
If (Left + Width > MdiParent.DisplayRectangle.Left + MdiParent.DisplayRectangle.Width) Then
Left = MdiParent.DisplayRectangle.Left + MdiParent.DisplayRectangle.Width - Width
End If
End Sub |
Partager