FormBorderStyle.None的Mdi.LayoutMdi方法 [英] Mdi.LayoutMdi method with FormBorderStyle.None
问题描述
我有一个Mdi表单,我通过将FormBorderStyle设置为"None"来为自己设置了表单。并为我的新表单边框创建用户控件。用户控件实现移动,调整大小,最小化,还原和关闭表单的功能。我的皮肤"Titlebar"控制抓取并显示"文本"。表单的属性以及表单图标。所有Mdi儿童都以同样的方式被剥皮。除了Mdi子布局之外,一切都工作很好。
当子节点的FormBorderStyle为"None"时,它们不受MdiParent格式的MdiLayout方法的影响。到目前为止,我通过临时将FormBorderStyle设置为"Sizable"来实现部分成功。然后回到例程的末尾,像这样......
Private Sub mnuBtnTileVertical_Click( ByVal 发件人作为对象,ByVal e As System.EventArgs)句柄 mnuBtnTileVertical.Click
每个 c As 表格 In Me .MdiChildren
c.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
下一步
我 .LayoutMdi(MdiLayout.TileVertical)
对于每个 c 作为表格在我 .MdiChildren
c。 FormBorderStyle = Windows.Forms.FormBorderStyle.None
Next
End Sub
问题是孩子形成的所有人最终都会在他们周围留出空白的地方在将FormBorderStyle设置回"None"之前绘制了非客户区域。在调用LayoutMdi之后,我尝试了各种方法来调整子窗体的大小以填充窗体的客户区域,但没有令人满意的结果。
有谁知道如何将ParentForm.LayoutoutMdi方法设置为Tile或Cascade无边框MdiChild表格?
I have a Mdi form that I have skinned myself by setting the FormBorderStyle to "None" and creating user controls for my new form border. The user controls implement the functionality to move, resize, minimize, restore, and close the form. My skinned "Titlebar" control grabs and displays the "Text" property of the form as well as the form icon. All the Mdi children are skinned in this same manner. Everything works peachy except Mdi child layout.
When the FormBorderStyle of the children is "None", they aren't affected by the MdiLayout method of the MdiParent form. Thus far, I have acheived partial success by temporarily setting the FormBorderStyle to "Sizable" and then back at the end of the routine, like this...
Private Sub mnuBtnTileVertical_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuBtnTileVertical.Click
For Each c As Form In Me.MdiChildren
c.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
Next
Me.LayoutMdi(MdiLayout.TileVertical)
For Each c As Form In Me.MdiChildren
c.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Next
End Sub
The problem is that the child forms all end up layed out with empty space around them where the non-client areas were painted before setting FormBorderStyle back to "None". I have tried a variety of ways to resize the child forms to fill the client area of the form after LayoutMdi is called, but with no satisfactory results.
Does anyone know how I can get the ParentForm.LayoutoutMdi method to Tile or Cascade borderless MdiChild forms?
推荐答案
我不确定你要问的是100%,但这里是我们如何根据您的需求设置可能会或可能不会帮助您的边界。生病了就把它扔出去:
I am not sure 100% of what you are asking, but here is how we set the border which may or may not help you depending on your needs. SO ill just throw this out there:
这篇关于FormBorderStyle.None的Mdi.LayoutMdi方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!