子窗口最大化不就完了?!
如果不是最大化,可以这样:
Dim f2 As New Form2()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f2.MdiParent = Me
f2.Show()
End Sub Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Not (f2 Is Nothing) Then
If f2.WindowState = FormWindowState.Normal Then
Debug.Assert(Me.ClientRectangle.Width = Me.ClientSize.Width)
Debug.Assert(Me.ClientRectangle.Height = Me.ClientSize.Height)
f2.SetBounds(0, 0, Me.ClientSize.Width - 4, Me.ClientSize.Height - 4) End If
End If
End Sub
如果不是最大化,可以这样:
Dim f2 As New Form2()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f2.MdiParent = Me
f2.Show()
End Sub Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Not (f2 Is Nothing) Then
If f2.WindowState = FormWindowState.Normal Then
Debug.Assert(Me.ClientRectangle.Width = Me.ClientSize.Width)
Debug.Assert(Me.ClientRectangle.Height = Me.ClientSize.Height)
f2.SetBounds(0, 0, Me.ClientSize.Width - 4, Me.ClientSize.Height - 4) End If
End If
End Sub
解决方案 »
- .Net Reactor混淆工具的使用
- 用C# 实现重力、初速度等
- 如何编写反病毒程序阿(C#可以么)
- 怎么用C#做一个网页编辑器????
- word 文件如何轉換成 tif 或者 gif 格式的文件
- 关于Infragistics WinGrid控件行滚动条的问题
- ListView的问题
- 急!!!——按位的与运算如何用C#实现??????
- 安装了。NET 2003 但不能运行 。NET程序!
- [System.ComponentModel.DesignerCategory("Code")]的问题
- 如何使SQLPARAMETERCOLLECTION对象实例化?
- 关于COLLECTION类型对象的创建
虽然我用硬编码的调整了一下,在我的窗体下由于有menu,toolbar,以及statusbar,所以最终
f2.SetBounds(0,0,this.ClientSize.Width - 6,this.ClientSize.Height - 74);
如果能够动态得出真实的客户区size更好,仍旧感谢。给分
Dim f2 As New Form2()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f2.MdiParent = Me
f2.Show()
f2.Dock = DockStyle.Fill
End Sub Private Sub Form1_Resize