DataGridViewCheckBoxColumn 建構函式

定義

初始化 DataGridViewCheckBoxColumn 類別的新執行個體。Initializes a new instance of the DataGridViewCheckBoxColumn class.

多載

DataGridViewCheckBoxColumn()

初始化 DataGridViewCheckBoxColumn 類別的新執行個體為預設狀態。Initializes a new instance of the DataGridViewCheckBoxColumn class to the default state.

DataGridViewCheckBoxColumn(Boolean)

初始化 DataGridViewCheckBoxColumn 的新執行個體,並設定其顯示具有兩種或三種狀態的核取方塊。Initializes a new instance of the DataGridViewCheckBoxColumn and configures it to display check boxes with two or three states.

DataGridViewCheckBoxColumn()

初始化 DataGridViewCheckBoxColumn 類別的新執行個體為預設狀態。Initializes a new instance of the DataGridViewCheckBoxColumn class to the default state.

public:
 DataGridViewCheckBoxColumn();
public DataGridViewCheckBoxColumn ();
Public Sub New ()

備註

使用這個無參數的函式相當於提供給函式的引數 false DataGridViewCheckBoxColumn(Boolean)Using this parameterless constructor is equivalent to supplying an argument of false to the DataGridViewCheckBoxColumn(Boolean) constructor.

另請參閱

適用於

DataGridViewCheckBoxColumn(Boolean)

初始化 DataGridViewCheckBoxColumn 的新執行個體,並設定其顯示具有兩種或三種狀態的核取方塊。Initializes a new instance of the DataGridViewCheckBoxColumn and configures it to display check boxes with two or three states.

public:
 DataGridViewCheckBoxColumn(bool threeState);
public DataGridViewCheckBoxColumn (bool threeState);
new System.Windows.Forms.DataGridViewCheckBoxColumn : bool -> System.Windows.Forms.DataGridViewCheckBoxColumn
Public Sub New (threeState As Boolean)

參數

threeState
Boolean

true 表示顯示具有三種狀態的核取方塊,false 表示顯示具有兩種狀態的核取方塊。true to display check boxes with three states; false to display check boxes with two states.

備註

這個函式會藉由設定下列屬性來初始化資料行。This constructor initializes the column by setting the following properties.

屬性Property Value
CellTemplate DataGridViewCheckBoxCellThreeState 屬性初始化為 threeState 參數值的新。A new DataGridViewCheckBoxCell with its ThreeState property initialized to the threeState parameter value.
ThreeState threeState 參數的值。The value of the threeState parameter.
DataGridViewColumn.SortMode DataGridViewColumnSortMode.NotSortable
Alignment屬性所傳回之 DataGridViewCellStyle 物件的屬性 DefaultCellStyleThe Alignment property of the DataGridViewCellStyle object returned by the DefaultCellStyle property. DataGridViewContentAlignment.MiddleCenter
NullValue屬性所傳回之 DataGridViewCellStyle 物件的屬性 DefaultCellStyleThe NullValue property of the DataGridViewCellStyle object returned by the DefaultCellStyle property. 如果 CheckState.IndeterminatethreeState,則為 true,否則為 falseCheckState.Indeterminate if threeState is true; otherwise, false.

另請參閱

適用於