DataGridViewCell.InheritedStyle 屬性

定義

取得目前套用至儲存格的樣式。

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

屬性

例外狀況

儲存格不屬於 DataGridView 控制項。

-或-

ColumnIndex 小於 0,表示儲存格是資料列行首儲存格。

包含儲存格的資料列是共用的資料列。

-或-

儲存格是資料行行首儲存格。

備註

控制項 DataGridView 會使用儲存格 InheritedStyle 屬性所指示的樣式來顯示其儲存格,而該樣式會繼承類型的其他屬性。 DataGridViewCellStyle 透過 Style 屬性指定的樣式會覆寫透過所有其他儲存格樣式屬性指定的樣式,但不一定表示參與儲存格外觀的所有樣式。

如需詳細資訊,請參閱Windows Forms DataGridView 控制項中的儲存格樣式

適用於

另請參閱