DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle Property

定義

取得目前套用至儲存格的樣式。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; }
member this.InheritedStyle : System.Windows.Forms.DataGridViewCellStyle
Public ReadOnly Property InheritedStyle As DataGridViewCellStyle

屬性值

例外狀況

儲存格不屬於 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.

備註

控制項會使用資料格InheritedStyle屬性所指示的樣式來顯示其資料格,而這會繼承類型DataGridViewCellStyle之其他屬性的樣式。 DataGridViewThe 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.

適用於

另請參閱