DataGridViewImageColumn 建構函式

定義

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

多載

DataGridViewImageColumn()

初始化 DataGridViewImageColumn 類別的新執行個體,將它設定為要與型別 Image 的儲存格值一起使用。Initializes a new instance of the DataGridViewImageColumn class, configuring it for use with cell values of type Image.

DataGridViewImageColumn(Boolean)

初始化 DataGridViewImageColumn 類別的新執行個體,選擇性地將它設定為要與 Icon 儲存格值一起使用。Initializes a new instance of the DataGridViewImageColumn class, optionally configuring it for use with Icon cell values.

DataGridViewImageColumn()

初始化 DataGridViewImageColumn 類別的新執行個體,將它設定為要與型別 Image 的儲存格值一起使用。Initializes a new instance of the DataGridViewImageColumn class, configuring it for use with cell values of type Image.

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

備註

這個函式呼叫DataGridViewImageColumn(Boolean) valuesAreIcons的參數值false為。This constructor calls DataGridViewImageColumn(Boolean) with a valuesAreIcons parameter value of false.

另請參閱

DataGridViewImageColumn(Boolean)

初始化 DataGridViewImageColumn 類別的新執行個體,選擇性地將它設定為要與 Icon 儲存格值一起使用。Initializes a new instance of the DataGridViewImageColumn class, optionally configuring it for use with Icon cell values.

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

參數

valuesAreIcons
Boolean

true 表示此資料行中的儲存格之 Value 屬性將會設定為型別 Icon 的值;false 表示此屬性將會設定為型別 Image 的值。true to indicate that the Value property of cells in this column will be set to values of type Icon; false to indicate that they will be set to values of type Image.

備註

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

屬性Property Value
CellTemplate DataGridViewImageCell的, 其ValueIsIcon屬性已初始化為valuesAreIcons參數值。A new DataGridViewImageCell with its ValueIsIcon property initialized to the valuesAreIcons parameter value.
ValuesAreIcons valuesAreIcons 參數的值。The value of the valuesAreIcons parameter.
屬性所傳回DataGridViewCellStyle Alignment之物件的屬性。 DefaultCellStyleThe Alignment property of the DataGridViewCellStyle object returned by the DefaultCellStyle property. DataGridViewContentAlignment.MiddleCenter
屬性所傳回DataGridViewCellStyle NullValue之物件的屬性。 DefaultCellStyleThe NullValue property of the DataGridViewCellStyle object returned by the DefaultCellStyle property. 如果Icon Bitmap false valuesAreIcons為, 則為類型的標準錯誤圖形, 如果為, 則為類型。 true valuesAreIconsA standard error graphic of type Icon if valuesAreIcons is true and type Bitmap if valuesAreIcons is false.

若要確保正確地繪製資料Icon格值的 Alpha 色板, 請使用此函式搭配valuesAreIcons的參數值trueTo ensure that the alpha channel of Icon cell values is painted correctly, use this constructor with a valuesAreIcons parameter value of true.

另請參閱

適用於