使用WeifenLuo DockPanel Suite [英] Using WeifenLuo DockPanel Suite
问题描述
我刚刚下载了 WeifenLuo(Dock Panel Suite),并尝试使用它,但是我找不到有关如何使用它的特定文档.
I have just downloaded the WeifenLuo(Dock Panel Suite) and trying to work with that but I couldn't find a specific documentation on how to use it.
我经历了一些SO问题,最后有了一些入门.
And I have gone through some of the SO questions and finally got something to get started.
这是我所做的: 我已经创建了一个ToolboxWindow类,如下所示:
Here is what I have done: I have created a ToolboxWindow class like shown below:
Public Class ToolboxWindow
Inherits WeifenLuo.WinFormsUI.Docking.DockContent
Public Sub New()
End Sub
End Class
并尝试以这种方式创建此工具箱的实例:
And trying to create an instance of this toolbox in this way:
Public Class Form1
Private toolboxWindow As ToolboxWindow
Public Sub New()
Me.InitializeComponent()
'Create new ToolboxWindow
toolboxWindow = New ToolboxWindow()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
'Show it
toolboxWindow.Show(DockPanel1, DockState.DockLeft)
End Sub
End Class
最后的结果以这种方式显示给我吗?
And the final result it shows me this way?
1.如何adjust
toolbox
的size
.
2.如果我在dock panel
中有form2
,该如何在form1
2.If I have form2
with the dock panel
how do I show in the form1
预先感谢!
推荐答案
Q1如何调整工具箱的大小.
DockPanel容器具有DockLeftPortion
属性(也为Right,Bottom和Top).这将左侧区域的宽度指定为像素或可用区域的比例.
我还没有看到任何能够使它具有停靠控件大小的功能.
The DockPanel container has a DockLeftPortion
property (Right, Bottom and Top too). This specifies the width of the left area as either pixels or a proportion of the available area.
I haven't seen anything that allows it to take on the size of the docked controls.
Q2如果我在停靠面板上有form2,该如何在form1中显示
如果您有两个带有停靠面板的顶级应用程序表单,则将适当的停靠面板控件作为第一个参数传递给Show()
方法.
If you have two top level application forms each with a dock panel, you pass the appropriate dockpanel control as the first parameter to the Show()
method.
这是第二季的意思吗?
Is this what you meant by Q2?
这篇关于使用WeifenLuo DockPanel Suite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!