SplitContainer 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一個由可移動橫條組成的控制面板,將貨櫃的展示區域分成兩個可調整大小的面板。
public ref class SplitContainer : System::Windows::Forms::ContainerControl
public ref class SplitContainer : System::Windows::Forms::ContainerControl, System::ComponentModel::ISupportInitialize
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)]
public class SplitContainer : System.Windows.Forms.ContainerControl
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)]
public class SplitContainer : System.Windows.Forms.ContainerControl, System.ComponentModel.ISupportInitialize
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)]
public class SplitContainer : System.Windows.Forms.ContainerControl, System.ComponentModel.ISupportInitialize
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)>]
type SplitContainer = class
inherit ContainerControl
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)>]
type SplitContainer = class
inherit ContainerControl
interface ISupportInitialize
[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)>]
type SplitContainer = class
inherit ContainerControl
interface ISupportInitialize
Public Class SplitContainer
Inherits ContainerControl
Public Class SplitContainer
Inherits ContainerControl
Implements ISupportInitialize
- 繼承
- 屬性
- 實作
範例
以下程式碼範例同時顯示垂直與水平 SplitContainer。 垂直分割器以 10 像素為單位移動。 垂直面板 SplitContainer 的左側面板包含一個 TreeView 控制點,右側面板則有一個水平面板 SplitContainer。 水平面板的兩個面板 SplitContainer 都被控制面板填滿 ListView ,而上方面板則被定義為 FixedPanel 不會在你調整容器大小時自動調整大小。 移動垂直分配器會提升事件, SplitterMoving 此例中透過游標樣式的改變表示。 當你停止移動分流器時,事件 SplitterMoved 會升起。 此範例中透過游標樣式回復預設來表示。
#using <System.Data.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
public ref class Form1: public System::Windows::Forms::Form
{
private:
System::Windows::Forms::SplitContainer^ splitContainer1;
System::Windows::Forms::TreeView^ treeView1;
System::Windows::Forms::SplitContainer^ splitContainer2;
System::Windows::Forms::ListView^ listView2;
System::Windows::Forms::ListView^ listView1;
public:
Form1()
{
InitializeComponent();
}
private:
void InitializeComponent()
{
splitContainer1 = gcnew System::Windows::Forms::SplitContainer;
treeView1 = gcnew System::Windows::Forms::TreeView;
splitContainer2 = gcnew System::Windows::Forms::SplitContainer;
listView1 = gcnew System::Windows::Forms::ListView;
listView2 = gcnew System::Windows::Forms::ListView;
splitContainer1->SuspendLayout();
splitContainer2->SuspendLayout();
SuspendLayout();
// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
splitContainer1->ForeColor = System::Drawing::SystemColors::Control;
splitContainer1->Location = System::Drawing::Point( 0, 0 );
splitContainer1->Name = "splitContainer1";
// You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1->Panel1MinSize = 30;
// You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1->Panel2MinSize = 20;
splitContainer1->Size = System::Drawing::Size( 292, 273 );
splitContainer1->SplitterDistance = 79;
// This splitter moves in 10-pixel increments.
splitContainer1->SplitterIncrement = 10;
splitContainer1->SplitterWidth = 6;
// splitContainer1 is the first control in the tab order.
splitContainer1->TabIndex = 0;
splitContainer1->Text = "splitContainer1";
// When the splitter moves, the cursor changes shape.
splitContainer1->SplitterMoved += gcnew System::Windows::Forms::SplitterEventHandler( this, &Form1::splitContainer1_SplitterMoved );
splitContainer1->SplitterMoving += gcnew System::Windows::Forms::SplitterCancelEventHandler( this, &Form1::splitContainer1_SplitterMoving );
// Add a TreeView control to the left panel.
splitContainer1->Panel1->BackColor = System::Drawing::SystemColors::Control;
// Add a TreeView control to Panel1.
splitContainer1->Panel1->Controls->Add( treeView1 );
splitContainer1->Panel1->Name = "splitterPanel1";
// Controls placed on Panel1 support right-to-left fonts.
splitContainer1->Panel1->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
// Add a SplitContainer to the right panel.
splitContainer1->Panel2->Controls->Add( splitContainer2 );
splitContainer1->Panel2->Name = "splitterPanel2";
// This TreeView control is in Panel1 of splitContainer1.
treeView1->Dock = System::Windows::Forms::DockStyle::Fill;
treeView1->ForeColor = System::Drawing::SystemColors::InfoText;
treeView1->ImageIndex = -1;
treeView1->Location = System::Drawing::Point( 0, 0 );
treeView1->Name = "treeView1";
treeView1->SelectedImageIndex = -1;
treeView1->Size = System::Drawing::Size( 79, 273 );
// treeView1 is the second control in the tab order.
treeView1->TabIndex = 1;
// Basic SplitContainer properties.
// This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed.
splitContainer2->Dock = System::Windows::Forms::DockStyle::Fill;
// The top panel remains the same size when the form is resized.
splitContainer2->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
splitContainer2->Location = System::Drawing::Point( 0, 0 );
splitContainer2->Name = "splitContainer2";
// Create the horizontal splitter.
splitContainer2->Orientation = System::Windows::Forms::Orientation::Horizontal;
splitContainer2->Size = System::Drawing::Size( 207, 273 );
splitContainer2->SplitterDistance = 125;
splitContainer2->SplitterWidth = 6;
// splitContainer2 is the third control in the tab order.
splitContainer2->TabIndex = 2;
splitContainer2->Text = "splitContainer2";
// This splitter panel contains the top ListView control.
splitContainer2->Panel1->Controls->Add( listView1 );
splitContainer2->Panel1->Name = "splitterPanel3";
// This splitter panel contains the bottom ListView control.
splitContainer2->Panel2->Controls->Add( listView2 );
splitContainer2->Panel2->Name = "splitterPanel4";
// This ListView control is in the top panel of splitContainer2.
listView1->Dock = System::Windows::Forms::DockStyle::Fill;
listView1->Location = System::Drawing::Point( 0, 0 );
listView1->Name = "listView1";
listView1->Size = System::Drawing::Size( 207, 125 );
// listView1 is the fourth control in the tab order.
listView1->TabIndex = 3;
// This ListView control is in the bottom panel of splitContainer2.
listView2->Dock = System::Windows::Forms::DockStyle::Fill;
listView2->Location = System::Drawing::Point( 0, 0 );
listView2->Name = "listView2";
listView2->Size = System::Drawing::Size( 207, 142 );
// listView2 is the fifth control in the tab order.
listView2->TabIndex = 4;
// These are basic properties of the form.
ClientSize = System::Drawing::Size( 292, 273 );
Controls->Add( splitContainer1 );
Name = "Form1";
Text = "Form1";
splitContainer1->ResumeLayout( false );
splitContainer2->ResumeLayout( false );
ResumeLayout( false );
}
void splitContainer1_SplitterMoving( System::Object^ /*sender*/, System::Windows::Forms::SplitterCancelEventArgs ^ /*e*/ )
{
// As the splitter moves, change the cursor type.
::Cursor::Current = System::Windows::Forms::Cursors::NoMoveVert;
}
void splitContainer1_SplitterMoved( System::Object^ /*sender*/, System::Windows::Forms::SplitterEventArgs^ /*e*/ )
{
// When the splitter stops moving, change the cursor back to the default.
::Cursor::Current = System::Windows::Forms::Cursors::Default;
}
};
[STAThread]
int main()
{
Application::Run( gcnew Form1 );
}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.ListView listView2;
private System.Windows.Forms.ListView listView1;
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
splitContainer1 = new System.Windows.Forms.SplitContainer();
treeView1 = new System.Windows.Forms.TreeView();
splitContainer2 = new System.Windows.Forms.SplitContainer();
listView1 = new System.Windows.Forms.ListView();
listView2 = new System.Windows.Forms.ListView();
splitContainer1.SuspendLayout();
splitContainer2.SuspendLayout();
SuspendLayout();
// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
splitContainer1.ForeColor = System.Drawing.SystemColors.Control;
splitContainer1.Location = new System.Drawing.Point(0, 0);
splitContainer1.Name = "splitContainer1";
// You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1.Panel1MinSize = 30;
// You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1.Panel2MinSize = 20;
splitContainer1.Size = new System.Drawing.Size(292, 273);
splitContainer1.SplitterDistance = 79;
// This splitter moves in 10-pixel increments.
splitContainer1.SplitterIncrement = 10;
splitContainer1.SplitterWidth = 6;
// splitContainer1 is the first control in the tab order.
splitContainer1.TabIndex = 0;
splitContainer1.Text = "splitContainer1";
// When the splitter moves, the cursor changes shape.
splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(splitContainer1_SplitterMoved);
splitContainer1.SplitterMoving += new System.Windows.Forms.SplitterCancelEventHandler(splitContainer1_SplitterMoving);
// Add a TreeView control to the left panel.
splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control;
// Add a TreeView control to Panel1.
splitContainer1.Panel1.Controls.Add(treeView1);
splitContainer1.Panel1.Name = "splitterPanel1";
// Controls placed on Panel1 support right-to-left fonts.
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
// Add a SplitContainer to the right panel.
splitContainer1.Panel2.Controls.Add(splitContainer2);
splitContainer1.Panel2.Name = "splitterPanel2";
// This TreeView control is in Panel1 of splitContainer1.
treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
treeView1.ForeColor = System.Drawing.SystemColors.InfoText;
treeView1.ImageIndex = -1;
treeView1.Location = new System.Drawing.Point(0, 0);
treeView1.Name = "treeView1";
treeView1.SelectedImageIndex = -1;
treeView1.Size = new System.Drawing.Size(79, 273);
// treeView1 is the second control in the tab order.
treeView1.TabIndex = 1;
// Basic SplitContainer properties.
// This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed.
splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
// The top panel remains the same size when the form is resized.
splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
splitContainer2.Location = new System.Drawing.Point(0, 0);
splitContainer2.Name = "splitContainer2";
// Create the horizontal splitter.
splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
splitContainer2.Size = new System.Drawing.Size(207, 273);
splitContainer2.SplitterDistance = 125;
splitContainer2.SplitterWidth = 6;
// splitContainer2 is the third control in the tab order.
splitContainer2.TabIndex = 2;
splitContainer2.Text = "splitContainer2";
// This splitter panel contains the top ListView control.
splitContainer2.Panel1.Controls.Add(listView1);
splitContainer2.Panel1.Name = "splitterPanel3";
// This splitter panel contains the bottom ListView control.
splitContainer2.Panel2.Controls.Add(listView2);
splitContainer2.Panel2.Name = "splitterPanel4";
// This ListView control is in the top panel of splitContainer2.
listView1.Dock = System.Windows.Forms.DockStyle.Fill;
listView1.Location = new System.Drawing.Point(0, 0);
listView1.Name = "listView1";
listView1.Size = new System.Drawing.Size(207, 125);
// listView1 is the fourth control in the tab order.
listView1.TabIndex = 3;
// This ListView control is in the bottom panel of splitContainer2.
listView2.Dock = System.Windows.Forms.DockStyle.Fill;
listView2.Location = new System.Drawing.Point(0, 0);
listView2.Name = "listView2";
listView2.Size = new System.Drawing.Size(207, 142);
// listView2 is the fifth control in the tab order.
listView2.TabIndex = 4;
// These are basic properties of the form.
ClientSize = new System.Drawing.Size(292, 273);
Controls.Add(splitContainer1);
Name = "Form1";
Text = "Form1";
splitContainer1.ResumeLayout(false);
splitContainer2.ResumeLayout(false);
ResumeLayout(false);
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void splitContainer1_SplitterMoving(System.Object sender, System.Windows.Forms.SplitterCancelEventArgs e)
{
// As the splitter moves, change the cursor type.
Cursor.Current = System.Windows.Forms.Cursors.NoMoveVert;
}
private void splitContainer1_SplitterMoved(System.Object sender, System.Windows.Forms.SplitterEventArgs e)
{
// When the splitter stops moving, change the cursor back to the default.
Cursor.Current=System.Windows.Forms.Cursors.Default;
}
}
' Compile this example using the following command line:
' vbc basicsplitcontainer.vb /r:System.Drawing.dll /r:System.Windows.Forms.dll /r:System.dll /r:System.Data.dll
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Public Class Form1
Inherits System.Windows.Forms.Form
Private WithEvents splitContainer1 As System.Windows.Forms.SplitContainer
Private treeView1 As System.Windows.Forms.TreeView
Private splitContainer2 As System.Windows.Forms.SplitContainer
Private listView2 As System.Windows.Forms.ListView
Private listView1 As System.Windows.Forms.ListView
Public Sub New()
InitializeComponent()
End Sub
Private Sub InitializeComponent()
splitContainer1 = New System.Windows.Forms.SplitContainer()
treeView1 = New System.Windows.Forms.TreeView()
splitContainer2 = New System.Windows.Forms.SplitContainer()
listView1 = New System.Windows.Forms.ListView()
listView2 = New System.Windows.Forms.ListView()
splitContainer1.SuspendLayout()
splitContainer2.SuspendLayout()
SuspendLayout()
' Basic SplitContainer properties.
' This is a vertical splitter that moves in 10-pixel increments.
' This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
splitContainer1.ForeColor = System.Drawing.SystemColors.Control
splitContainer1.Location = New System.Drawing.Point(0, 0)
splitContainer1.Name = "splitContainer1"
' You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1.Panel1MinSize = 30
' You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1.Panel2MinSize = 20
splitContainer1.Size = New System.Drawing.Size(292, 273)
splitContainer1.SplitterDistance = 79
' This splitter moves in 10-pixel increments.
splitContainer1.SplitterIncrement = 10
splitContainer1.SplitterWidth = 6
' splitContainer1 is the first control in the tab order.
splitContainer1.TabIndex = 0
splitContainer1.Text = "splitContainer1"
' Add a TreeView control to the left panel.
splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control
' Add a TreeView control to Panel1.
splitContainer1.Panel1.Controls.Add(treeView1)
splitContainer1.Panel1.Name = "splitterPanel1"
' Controls placed on Panel1 support right-to-left fonts.
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes
' Add a SplitContainer to the right panel.
splitContainer1.Panel2.Controls.Add(splitContainer2)
splitContainer1.Panel2.Name = "splitterPanel2"
' This TreeView control is in Panel1 of splitContainer1.
treeView1.Dock = System.Windows.Forms.DockStyle.Fill
treeView1.ForeColor = System.Drawing.SystemColors.InfoText
treeView1.ImageIndex = - 1
treeView1.Location = New System.Drawing.Point(0, 0)
treeView1.Name = "treeView1"
treeView1.SelectedImageIndex = - 1
treeView1.Size = New System.Drawing.Size(79, 273)
' treeView1 is the second control in the tab order.
treeView1.TabIndex = 1
' Basic SplitContainer properties.
' This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed.
splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill
' The top panel remains the same size when the form is resized.
splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1
splitContainer2.Location = New System.Drawing.Point(0, 0)
splitContainer2.Name = "splitContainer2"
' Create the horizontal splitter.
splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal
splitContainer2.Size = New System.Drawing.Size(207, 273)
splitContainer2.SplitterDistance = 125
splitContainer2.SplitterWidth = 6
' splitContainer2 is the third control in the tab order.
splitContainer2.TabIndex = 2
splitContainer2.Text = "splitContainer2"
' This splitter panel contains the top ListView control.
splitContainer2.Panel1.Controls.Add(listView1)
splitContainer2.Panel1.Name = "splitterPanel3"
' This splitter panel contains the bottom ListView control.
splitContainer2.Panel2.Controls.Add(listView2)
splitContainer2.Panel2.Name = "splitterPanel4"
' This ListView control is in the top panel of splitContainer2.
listView1.Dock = System.Windows.Forms.DockStyle.Fill
listView1.Location = New System.Drawing.Point(0, 0)
listView1.Name = "listView1"
listView1.Size = New System.Drawing.Size(207, 125)
' listView1 is the fourth control in the tab order.
listView1.TabIndex = 3
' This ListView control is in the bottom panel of splitContainer2.
listView2.Dock = System.Windows.Forms.DockStyle.Fill
listView2.Location = New System.Drawing.Point(0, 0)
listView2.Name = "listView2"
listView2.Size = New System.Drawing.Size(207, 142)
' listView2 is the fifth control in the tab order.
listView2.TabIndex = 4
' These are basic properties of the form.
ClientSize = New System.Drawing.Size(292, 273)
Controls.Add(splitContainer1)
Name = "Form1"
Text = "Form1"
splitContainer1.ResumeLayout(False)
splitContainer2.ResumeLayout(False)
ResumeLayout(False)
End Sub
<STAThread()> _
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub splitContainer1_SplitterMoving(sender As System.Object, e As System.Windows.Forms.SplitterCancelEventArgs) Handles splitContainer1.SplitterMoving
' As the splitter moves, change the cursor type.
Cursor.Current = System.Windows.Forms.Cursors.NoMoveVert
End Sub
Private Sub splitContainer1_SplitterMoved(sender As System.Object, e As System.Windows.Forms.SplitterEventArgs) Handles splitContainer1.SplitterMoved
' When the splitter stops moving, change the cursor back to the default.
Cursor.Current = System.Windows.Forms.Cursors.Default
End Sub
End Class
備註
你可以在兩個可調整大小的面板上新增控制項,也可以在現有SplitContainer面板上加入其他SplitContainer控制項,來創造許多可調整大小的顯示區域。
使用 SplitContainer 控制項來分割容器(例如 ) Form的顯示區域,並允許使用者調整新增 SplitContainer 到面板上的控制項大小。 當使用者將滑鼠指標移動到分配器上時,游標會改變,表示控制器內 SplitContainer 的控制項可以調整大小。
備註
先前版本的 .NET Framework 僅支援控制項 Splitter 。
SplitContainer 同時也方便設計時的控制裝置放置。 例如,要建立類似 Windows 檔案總管的視窗,可以在 a 中加入SplitContainer一個控制項,並將其屬性設Dock為 DockStyle.Fill。Form 在 中Form加入一個TreeView控制項,並將其屬性設Dock為 DockStyle.Fill。 為了完成版面配置,加入一個 ListView 控制項並將其屬性設 Dock 為 DockStyle.Fill ,使 佔 ListView 據 Form. 執行時,使用者可利用分配器調整兩個控制點的寬度。 利用該 FixedPanel 屬性指定控制項不應與其他 Form 容器一起調整大小。
用 SplitterDistance 來指定分線器在你形態上的起點。 用來 SplitterIncrement 指定分配器每次移動多少像素。 預設是 1 SplitterIncrement 像素。
用 Panel1MinSize 和 Panel2MinSize 來指定分線桿可以移動到配電盤外緣 SplitContainer 的距離。 面板的預設最小尺寸是 25 像素。
使用該 Orientation 屬性來指定水平方向。 預設的方向 SplitContainer 是垂直的。
使用該 BorderStyle 屬性指定 的 SplitContainer 邊框樣式,並將其邊框樣式與你新增 SplitContainer的控制項邊框樣式協調。
建構函式
| 名稱 | Description |
|---|---|
| SplitContainer() |
初始化 SplitContainer 類別的新執行個體。 |
欄位
| 名稱 | Description |
|---|---|
| ScrollStateAutoScrolling |
決定房產價值 AutoScroll 。 (繼承來源 ScrollableControl) |
| ScrollStateFullDrag |
判斷使用者是否啟用了完整視窗拖曳。 (繼承來源 ScrollableControl) |
| ScrollStateHScrollVisible |
決定屬性值是否 HScroll 設為 |
| ScrollStateUserHasScrolled |
判斷使用者是否滑動過 ScrollableControl 控制項。 (繼承來源 ScrollableControl) |
| ScrollStateVScrollVisible |
決定屬性值是否 VScroll 設為 |
屬性
| 名稱 | Description |
|---|---|
| AccessibilityObject |
讓被 AccessibleObject 指派到控制室。 (繼承來源 Control) |
| AccessibleDefaultActionDescription |
取得或設定控制項的預設動作描述,供無障礙客戶端應用程式使用。 (繼承來源 Control) |
| AccessibleDescription |
取得或設定無障礙客戶端應用程式所使用的控制項描述。 (繼承來源 Control) |
| AccessibleName |
取得或設定無障礙客戶端應用程式所使用的控制項名稱。 (繼承來源 Control) |
| AccessibleRole |
取得或設定控制的可及角色。 (繼承來源 Control) |
| ActiveControl |
取得或設定容器控制的主動控制。 (繼承來源 ContainerControl) |
| AllowDrop |
取得或設定一個值,指示控制器是否能接受使用者拖曳到的資料。 (繼承來源 Control) |
| Anchor |
取得或設定控制項綁定容器的邊緣,並決定控制項如何與父控制項進行調整大小。 (繼承來源 Control) |
| AutoScaleDimensions |
取得或設定控制器設計的尺寸。 (繼承來源 ContainerControl) |
| AutoScaleFactor |
取得目前與設計時自動縮放尺寸之間的縮放因子。 (繼承來源 ContainerControl) |
| AutoScaleMode |
取得或設定控制器的自動縮放模式。 (繼承來源 ContainerControl) |
| AutoScroll |
當在派生類別中被覆寫時,會獲得或設定一個值,指示如果控制項置於用戶端區域外 SplitContainer ,滾動條是否會自動出現。 此性質與此類別無關。 |
| AutoScrollMargin |
設定自動捲動邊距的大小。 此性質與此類別無關。 此性質與此類別無關。 |
| AutoScrollMinSize |
取得或設定滾動條的最小大小。 此性質與此類別無關。 |
| AutoScrollOffset |
此性質與此類別無關。 |
| AutoScrollPosition |
此性質與此類別無關。 |
| AutoSize |
取得或設定一個值,指示是否 SplitContainer 會自動調整大小以顯示其全部內容。 此性質與此類別無關。 |
| AutoValidate |
取得或設定一個值,指示當焦點改變時,容器中的控制項是否會自動驗證。 (繼承來源 ContainerControl) |
| BackColor |
取得或設定控制點的背景色。 (繼承來源 Control) |
| BackgroundImage |
取得或設定控制中顯示的背景影像。 |
| BackgroundImageLayout |
此性質與此類別無關。 |
| BindingContext |
取得或設定 BindingContext 。SplitContainer |
| BorderStyle |
取得或設定邊框的樣式。SplitContainer |
| Bottom |
取得控制項底部邊緣與容器用戶端區域頂部邊緣之間的距離(像素)。 (繼承來源 Control) |
| Bounds |
取得或設定控制項的大小與位置,包括非用戶端元素,以像素為單位,相對於父控制項。 (繼承來源 Control) |
| CanEnableIme |
會取得一個值,表示該屬性是否 ImeMode 能被設定為主動值,以支援 IME。 (繼承來源 ContainerControl) |
| CanFocus |
會獲得一個值,表示控制點是否能獲得焦點。 (繼承來源 Control) |
| CanRaiseEvents |
判斷事件是否能在控制組上引發。 (繼承來源 Control) |
| CanSelect |
會得到一個值,表示是否可以選擇該控制項。 (繼承來源 Control) |
| Capture |
取得或設定一個值,表示控制器是否已捕捉該滑鼠。 (繼承來源 Control) |
| CausesValidation |
取得或設定一個值,指示該控制是否導致在收到焦點時對需要驗證的控制項進行驗證。 (繼承來源 Control) |
| ClientRectangle |
取得代表控制區客戶端區域的矩形。 (繼承來源 Control) |
| ClientSize |
取得或設定控制區客戶區域的高度與寬度。 (繼承來源 Control) |
| CompanyName |
取得包含控制權的公司名稱或應用程式的創建者名稱。 (繼承來源 Control) |
| Container |
得到 IContainer 包含 Component的 。 (繼承來源 Component) |
| ContainsFocus |
會獲得一個值,表示該控制項或其子控制項目前是否擁有輸入焦點。 (繼承來源 Control) |
| ContextMenu |
已淘汰.
取得或設定與控制鍵相關的捷徑選單。 (繼承來源 Control) |
| ContextMenuStrip |
取得或設定 ContextMenuStrip 與此控制相關聯的 (繼承來源 Control) |
| Controls |
拿到一堆兒童控制系統。 此性質與此類別無關。 |
| Created |
會得到一個值,表示控制是否已被建立。 (繼承來源 Control) |
| CreateParams |
當控制句柄建立時,會取得所需的建立參數。 (繼承來源 ContainerControl) |
| CurrentAutoScaleDimensions |
取得螢幕目前的運行時間尺寸。 (繼承來源 ContainerControl) |
| Cursor |
當滑鼠指標位於控制器上時,會顯示或設定游標。 (繼承來源 Control) |
| DataBindings |
取得控制項的資料綁定。 (繼承來源 Control) |
| DataContext |
取得或設定資料上下文以進行資料綁定。 這是一個環境音屬性。 (繼承來源 Control) |
| DefaultCursor |
取得或設定控制鍵的預設游標。 (繼承來源 Control) |
| DefaultImeMode |
可獲得控制項所支援的預設輸入法編輯器(IME)模式。 (繼承來源 Control) |
| DefaultMargin |
取得預設控制點間設定的像素空間。 (繼承來源 Control) |
| DefaultMaximumSize |
取得控制項預設最大大小的長度與高度(像素數)。 (繼承來源 Control) |
| DefaultMinimumSize |
取得控制項預設最小大小的長度與高度(像素)。 (繼承來源 Control) |
| DefaultPadding |
取得控制項內容的預設內部間距(像素)。 (繼承來源 Control) |
| DefaultSize |
會得到預設大小的 SplitContainer。 |
| DesignMode |
會得到一個值,表示目前 Component 是否處於設計模式。 (繼承來源 Component) |
| DeviceDpi |
取得目前顯示控制項所在顯示器的 DPI 值。 (繼承來源 Control) |
| DisplayRectangle |
取得代表控制器虛擬顯示區域的矩形。 (繼承來源 ScrollableControl) |
| Disposing |
會取得一個值,表示基底 Control 類別是否正在處理中。 (繼承來源 Control) |
| Dock |
設定容器 SplitContainer 邊緣的邊界。 |
| DockPadding |
可以取得控制器所有邊緣的底座填充設定。 (繼承來源 ScrollableControl) |
| DoubleBuffered |
會取得或設定一個值,指示該控制器是否應該使用次級緩衝區重新繪製表面以減少或防止閃爍。 (繼承來源 Control) |
| Enabled |
取得或設定一個值,表示控制項是否能回應使用者互動。 (繼承來源 Control) |
| Events |
會取得與此 Component連結的事件處理程序清單。 (繼承來源 Component) |
| FixedPanel |
當容器尺寸調整時,會取得或設定哪個 SplitContainer 面板大小不變。 |
| Focused |
會得到一個值,表示控制器是否有輸入焦點。 (繼承來源 Control) |
| Font |
取得或設定控制項顯示文字的字型。 (繼承來源 Control) |
| FontHeight |
取得或設定控制鍵字型的高度。 (繼承來源 Control) |
| ForeColor |
取得或設定控制鍵的前景色。 (繼承來源 Control) |
| Handle |
它會得到控制項綁定的視窗把手。 (繼承來源 Control) |
| HasChildren |
會取得一個值,表示該控制是否包含一個或多個子控制項。 (繼承來源 Control) |
| Height |
取得或設定控制點的高度。 (繼承來源 Control) |
| HorizontalScroll |
取得與水平捲動條相關的特性。 (繼承來源 ScrollableControl) |
| HScroll |
會取得或設定一個值,表示水平滾動條是否可見。 (繼承來源 ScrollableControl) |
| ImeMode |
取得或設定控制器的輸入法編輯器(IME)模式。 (繼承來源 Control) |
| ImeModeBase |
取得或設定控制的 IME 模式。 (繼承來源 Control) |
| InvokeRequired |
會獲得一個值,表示呼叫者在呼叫控制項時是否必須呼叫呼叫方法,因為呼叫者使用的執行緒與該控制項建立的執行緒不同。 (繼承來源 Control) |
| IsAccessible |
取得或設定一個值,指示該控制項是否對無障礙應用程式可見。 (繼承來源 Control) |
| IsAncestorSiteInDesignMode |
顯示該控制點的前祖是否被設置在 DesignMode 中。 這個屬性是唯讀的。 (繼承來源 Control) |
| IsDisposed |
會有一個值,表示控制權是否已被處理掉。 (繼承來源 Control) |
| IsHandleCreated |
會得到一個值,表示該控制項是否有與其相關的 handle。 (繼承來源 Control) |
| IsMirrored |
會得到一個值,表示該控制是否為鏡像。 (繼承來源 Control) |
| IsSplitterFixed |
會取得或設定一個值,指示分流器是固定還是可移動。 |
| LayoutEngine |
會取得控制點的佈局引擎的快取實例。 (繼承來源 Control) |
| Left |
取得或設定控制項左邊與容器客戶端區域左邊之間的距離(像素)。 (繼承來源 Control) |
| Location |
取得或設定控制器左上角相對於容器左上角的座標。 (繼承來源 Control) |
| Margin |
取得或設定控制區之間的空格。 (繼承來源 Control) |
| MaximumSize |
取得或設定的上限是可以指定的上限 GetPreferredSize(Size) 。 (繼承來源 Control) |
| MinimumSize |
取得或設定的尺寸是可指定的下限 GetPreferredSize(Size) 。 (繼承來源 Control) |
| Name |
取得或設定控制的名稱。 (繼承來源 Control) |
| Orientation |
會取得或設定一個數值,指示面板的水平或垂直方向 SplitContainer 。 |
| Padding |
取得或設定內部間距,以像素為單位,介於 a SplitterPanel 的邊緣與內容物之間。 此性質與此類別無關。 |
| Panel1 |
會得到 的左側或頂部面板 SplitContainer,視情況 Orientation而定。 |
| Panel1Collapsed |
取得或設定一個決定 Panel1 是收縮還是擴展的值。 |
| Panel1MinSize |
取得或設定分離器從左邊或上邊 Panel1的最小像素距離。 |
| Panel2 |
根據情況Orientation,得到右側或底部面板SplitContainer。 |
| Panel2Collapsed |
取得或設定一個決定 Panel2 是收縮還是擴展的值。 |
| Panel2MinSize |
取得或設定分離器從右邊或底部邊緣 Panel2的最小像素距離。 |
| Parent |
取得或設定控制的父容器。 (繼承來源 Control) |
| ParentForm |
會拿到容器控制所指派的表單。 (繼承來源 ContainerControl) |
| PreferredSize |
大小相當於一個長方形區域,控制器可以放進去。 (繼承來源 Control) |
| ProductName |
取得包含控制項的組件產品名稱。 (繼承來源 Control) |
| ProductVersion |
取得包含控制項的組裝版本。 (繼承來源 Control) |
| RecreatingHandle |
會取得一個值,表示該控制項目前是否正在重新建立其句柄。 (繼承來源 Control) |
| Region |
取得或設定與控制項相關的視窗區域。 (繼承來源 Control) |
| RenderRightToLeft |
已淘汰.
已淘汰.
該物業現已過時。 (繼承來源 Control) |
| ResizeRedraw |
會取得或設定一個值,表示控制項在調整時是否會自行重新繪製。 (繼承來源 Control) |
| Right |
取得控制器右邊與容器用戶端區域左邊之間的距離(像素)。 (繼承來源 Control) |
| RightToLeft |
取得或設定一個值,指示 control 元素是否對齊以支援使用右至左字型的區域。 (繼承來源 Control) |
| ScaleChildren |
會得到一個決定子控制項縮放的值。 (繼承來源 Control) |
| ShowFocusCues |
會得到一個值,指示控制器是否應該顯示焦點矩形。 (繼承來源 Control) |
| ShowKeyboardCues |
會取得一個值,表示使用者介面是否處於顯示或隱藏鍵盤加速器的適當狀態。 (繼承來源 Control) |
| Site |
取得或設定控制點。 (繼承來源 Control) |
| Size |
設定控制器的高度與寬度。 (繼承來源 Control) |
| SplitterDistance |
從 的左邊或上緣 SplitContainer取得或設定分線器的位置(以像素為單位)。 |
| SplitterIncrement |
取得或設定一個代表分割器移動增量(以像素為單位)的值。 |
| SplitterRectangle |
取得分線器的大小與位置相對於 SplitContainer。 |
| SplitterWidth |
它會設定或設定分線器的寬度(以像素為單位)。 |
| TabIndex |
取得或設定容器內控制項的制表順序。 (繼承來源 Control) |
| TabStop |
取得或設定一個值,指示使用者是否能使用 TAB 鍵將焦點分配給分配器。 |
| Tag |
取得或設定包含控制項資料的物件。 (繼承來源 Control) |
| Text |
此性質與此類別無關。 |
| Top |
取得或設定控制面板頂端與容器用戶端區域頂端之間的距離(以像素為單位)。 (繼承來源 Control) |
| TopLevelControl |
取得沒有被其他 Windows Forms 控制項保護的父控制權。 通常,這是控制所包含的最 Form 外層。 (繼承來源 Control) |
| UseWaitCursor |
取得或設定一個值,指示是否使用等待游標來控制目前的控制項及所有子控制項。 (繼承來源 Control) |
| VerticalScroll |
取得與垂直捲動條相關的特性。 (繼承來源 ScrollableControl) |
| Visible |
取得或設定一個值,表示該控制項及其所有子控制項是否被顯示。 (繼承來源 Control) |
| VScroll |
會取得或設定一個值,表示垂直捲動條是否可見。 (繼承來源 ScrollableControl) |
| Width |
設定或設定控制寬度。 (繼承來源 Control) |
| WindowTarget |
此性質對此類別無關。 (繼承來源 Control) |
方法
事件
| 名稱 | Description |
|---|---|
| AutoSizeChanged |
發生於 AutoSize 屬性的值變更時。 此性質與此類別無關。 |
| AutoValidateChanged |
當房產變更時 AutoValidate 發生。 (繼承來源 ContainerControl) |
| BackColorChanged |
發生於 BackColor 屬性的值變更時。 (繼承來源 Control) |
| BackgroundImageChanged |
當房產變更時 BackgroundImage 發生。 |
| BackgroundImageLayoutChanged |
當房產變更時 BackgroundImageLayout 發生。 這個活動與本課程無關。 |
| BindingContextChanged |
發生於 BindingContext 屬性的值變更時。 (繼承來源 Control) |
| CausesValidationChanged |
發生於 CausesValidation 屬性的值變更時。 (繼承來源 Control) |
| ChangeUICues |
當焦點或鍵盤使用者介面(UI)提示改變時,會發生這種情況。 (繼承來源 Control) |
| Click |
當按下控制器時會發生。 (繼承來源 Control) |
| ClientSizeChanged |
發生於 ClientSize 屬性的值變更時。 (繼承來源 Control) |
| ContextMenuChanged |
已淘汰.
發生於 ContextMenu 屬性的值變更時。 (繼承來源 Control) |
| ContextMenuStripChanged |
發生於 ContextMenuStrip 屬性的值變更時。 (繼承來源 Control) |
| ControlAdded |
這個活動與本課程無關。 |
| ControlRemoved |
這個活動與本課程無關。 |
| CursorChanged |
發生於 Cursor 屬性的值變更時。 (繼承來源 Control) |
| DataContextChanged |
發生於 DataContext 屬性的值變更時。 (繼承來源 Control) |
| Disposed |
當元件被呼叫方法 Dispose() 時會發生。 (繼承來源 Component) |
| DockChanged |
發生於 Dock 屬性的值變更時。 (繼承來源 Control) |
| DoubleClick |
當雙擊按鈕時會發生。 (繼承來源 Control) |
| DpiChangedAfterParent |
當控制器的 DPI 設定在父控制器或表單的 DPI 改變後,程式方式更改時會發生。 (繼承來源 Control) |
| DpiChangedBeforeParent |
當控制器的 DPI 設定在父控制器或表單的 DPI 變更事件尚未發生之前,程式化地更改時就會發生。 (繼承來源 Control) |
| DragDrop |
當拖放操作完成時會發生。 (繼承來源 Control) |
| DragEnter |
當物體被拖入控制範圍時,會發生這種情況。 (繼承來源 Control) |
| DragLeave |
當物體被拖出控制範圍時,會發生這種情況。 (繼承來源 Control) |
| DragOver |
當物體被拖過控制範圍時會發生。 (繼承來源 Control) |
| EnabledChanged |
發生於 Enabled 屬性值變更時。 (繼承來源 Control) |
| Enter |
當進入控制區時發生。 (繼承來源 Control) |
| FontChanged |
當房產價值變動時 Font 發生。 (繼承來源 Control) |
| ForeColorChanged |
當房產價值變動時 ForeColor 發生。 (繼承來源 Control) |
| GiveFeedback |
發生在拖曳操作期間。 (繼承來源 Control) |
| GotFocus |
當控制裝置被聚焦時發生。 (繼承來源 Control) |
| HandleCreated |
當控制器被建立把柄時,會發生這種情況。 (繼承來源 Control) |
| HandleDestroyed |
當控制器的把手正在被摧毀時,會發生這種情況。 (繼承來源 Control) |
| HelpRequested |
當使用者請求控制權協助時會發生。 (繼承來源 Control) |
| ImeModeChanged |
當房產發生變化時 ImeMode 。 (繼承來源 Control) |
| Invalidated |
當控制器顯示需要重新繪製時,會發生這種情況。 (繼承來源 Control) |
| KeyDown |
當按鍵時,控制器處於焦點狀態時會發生。 (繼承來源 Control) |
| KeyPress |
當按鍵在控制鍵處於焦點狀態時,按下字元、空白鍵或退格鍵時會發生。 (繼承來源 Control) |
| KeyUp |
當控制鍵處於對焦狀態時放開鍵時會發生。 (繼承來源 Control) |
| Layout |
當控制項應該重新定位其子控制項時,會發生這種情況。 (繼承來源 Control) |
| Leave |
當輸入焦點離開控制器時會發生。 (繼承來源 Control) |
| LocationChanged |
發生於 Location 屬性值變更時。 (繼承來源 Control) |
| LostFocus |
當控制失焦時會發生。 (繼承來源 Control) |
| MarginChanged |
當對照組的邊界改變時會發生。 (繼承來源 Control) |
| MouseCaptureChanged |
當控制組失去滑鼠捕捉時會發生。 (繼承來源 Control) |
| MouseClick |
當滑鼠點擊控制鍵時會發生。 (繼承來源 Control) |
| MouseDoubleClick |
當滑鼠雙擊控制鍵時會發生。 (繼承來源 Control) |
| MouseDown |
當滑鼠指標放在控制器上,按下滑鼠按鈕時會發生。 (繼承來源 Control) |
| MouseEnter |
當滑鼠指標進入控制鍵時會發生。 (繼承來源 Control) |
| MouseHover |
當滑鼠指標放在控制器上時會發生。 (繼承來源 Control) |
| MouseLeave |
當滑鼠指標離開控制鍵時會發生。 (繼承來源 Control) |
| MouseMove |
當滑鼠指標移到控制器上時會發生。 (繼承來源 Control) |
| MouseUp |
當滑鼠指標放在控制器上方並放開滑鼠按鈕時,會發生這種情況。 (繼承來源 Control) |
| MouseWheel |
當滑鼠滾輪移動時,控制器仍保持對焦。 (繼承來源 Control) |
| Move |
當控制桿移動時會發生。 (繼承來源 Control) |
| PaddingChanged |
這個活動與本課程無關。 |
| Paint |
當控制鍵重新繪製時會發生。 (繼承來源 Control) |
| ParentChanged |
當房產價值變動時 Parent 發生。 (繼承來源 Control) |
| PreviewKeyDown |
當按鍵在該控制鍵上時,會發生在事件發生 KeyDown 前。 (繼承來源 Control) |
| QueryAccessibilityHelp |
當 AccessibleObject 提供無障礙應用程式協助時,會發生這種情況。 (繼承來源 Control) |
| QueryContinueDrag |
發生在拖放操作期間,使拖曳源判斷是否應該取消拖放操作。 (繼承來源 Control) |
| RegionChanged |
發生於 Region 屬性的值變更時。 (繼承來源 Control) |
| Resize |
當控制大小被調整時會發生。 (繼承來源 Control) |
| RightToLeftChanged |
當房產價值變動時 RightToLeft 發生。 (繼承來源 Control) |
| Scroll |
當使用者或程式碼在客戶端區域滾動時會發生。 (繼承來源 ScrollableControl) |
| SizeChanged |
當房產價值變動時 Size 發生。 (繼承來源 Control) |
| SplitterMoved |
當分線器控制被移動時會發生。 |
| SplitterMoving |
當分線器控制正在移動時會發生。 |
| StyleChanged |
當控制風格改變時會發生。 (繼承來源 Control) |
| SystemColorsChanged |
當系統顏色改變時會發生。 (繼承來源 Control) |
| TabIndexChanged |
當房產價值變動時 TabIndex 發生。 (繼承來源 Control) |
| TabStopChanged |
當房產價值變動時 TabStop 發生。 (繼承來源 Control) |
| TextChanged |
這個活動與本課程無關。 |
| Validated |
當控制驗證完成時發生。 (繼承來源 Control) |
| Validating |
當對照組進行驗證時會發生。 (繼承來源 Control) |
| VisibleChanged |
當房產價值變動時 Visible 發生。 (繼承來源 Control) |
明確介面實作
| 名稱 | Description |
|---|---|
| IContainerControl.ActivateControl(Control) |
啟動指定的控制。 (繼承來源 ContainerControl) |
| IDropTarget.OnDragDrop(DragEventArgs) |
引發 DragDrop 事件。 (繼承來源 Control) |
| IDropTarget.OnDragEnter(DragEventArgs) |
引發 DragEnter 事件。 (繼承來源 Control) |
| IDropTarget.OnDragLeave(EventArgs) |
引發 DragLeave 事件。 (繼承來源 Control) |
| IDropTarget.OnDragOver(DragEventArgs) |
引發 DragOver 事件。 (繼承來源 Control) |