如何在MDIParent的右下角定位MDIChild表单?

时间:2012-04-04 13:54:58

标签: vb.net mdichild mdiparent

看起来像一个愚蠢的问题,但我尝试了以下(其中“我”是MDIParent表单):

Dim frmNotif As New frmNotifica
With frmNotif
  .MdiParent = Me
  .StartPosition = FormStartPosition.Manual
  .Location = New Point(ClientSize.Width - .Width, ClientSize.Height - .Height)
  .Show()
End With

但它不起作用。

想法?

1 个答案:

答案 0 :(得分:2)

假设您有一个“空”MDI父表单(没有Panels或ToolStrips停靠),这应该有效:

Dim frmNotif As New frmNotifica
With frmNotif
  .MdiParent = Me
  .StartPosition = FormStartPosition.Manual

  Dim leftStart As Integer = Me.ClientSize.Width - (.Width + (SystemInformation.Border3DSize.Width * 2))
  Dim topStart As Integer = Me.ClientSize.Height - (.Height + (SystemInformation.Border3DSize.Height * 2))

  .Location = New Point(leftStart, topStart)
  .Show()
End With

如果你有一个Panel或ToolStrip添加到MDIParent,你也必须将它计入你的等式中。