DataGridViewCell.InheritedStyle 屬性

定義

取得目前套用至儲存格的樣式。Gets the style currently applied to the cell.

public:
 property System::Windows::Forms::DataGridViewCellStyle ^ InheritedStyle { System::Windows::Forms::DataGridViewCellStyle ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.DataGridViewCellStyle InheritedStyle { get; }
[<System.ComponentModel.Browsable(false)>]
member this.InheritedStyle : System.Windows.Forms.DataGridViewCellStyle
Public ReadOnly Property InheritedStyle As DataGridViewCellStyle

屬性值

DataGridViewCellStyle

目前套用至儲存格的 DataGridViewCellStyleThe DataGridViewCellStyle currently applied to the cell.

屬性

例外狀況

儲存格不屬於 DataGridView 控制項。The cell does not belong to a DataGridView control.

-或--or- ColumnIndex 小於 0,表示儲存格是資料列行首儲存格。ColumnIndex is less than 0, indicating that the cell is a row header cell.

包含儲存格的資料列是共用的資料列。The row containing the cell is a shared row.

-或--or-

儲存格是資料行行首儲存格。The cell is a column header cell.

備註

DataGridView控制項會使用資料格屬性所指示的樣式來顯示其資料格 InheritedStyle ,而這會繼承類型之其他屬性的樣式 DataGridViewCellStyleThe DataGridView control displays its cells using the styles indicated by the cell InheritedStyle property, which inherits styles from other properties of type DataGridViewCellStyle. 透過屬性指定的樣式 Style 會覆寫透過所有其他儲存格樣式屬性所指定的樣式,但不一定會指出構成儲存格外觀的所有樣式。The styles specified through the Style property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance.

如需詳細資訊,請參閱 Windows Forms DataGridView 控制項中的儲存格樣式For more information, see Cell Styles in the Windows Forms DataGridView Control.

適用於

另請參閱