DataGridViewBand.HasDefaultCellStyle 屬性

定義

取得指出是否已經設定 DefaultCellStyle 屬性的值。

public:
 property bool HasDefaultCellStyle { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool HasDefaultCellStyle { get; }
[<System.ComponentModel.Browsable(false)>]
member this.HasDefaultCellStyle : bool
Public ReadOnly Property HasDefaultCellStyle As Boolean

屬性值

Boolean

如果 DefaultCellStyle 屬性已經設定,則為 true,否則為 false

屬性

備註

如果先前尚未存取屬性,取得屬性的值 DefaultCellStyle 會自動具現化新的 DataGridViewCellStyle 。 因此,您必須使用 HasDefaultCellStyle 屬性來判斷屬性目前是否 DefaultCellStyle 設定為 DataGridViewCellStyle 實例。 這適用于判斷屬性所 InheritedStyle 傳回之物件的哪些屬性代表特別針對訊號範圍所設定的樣式。

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

適用於

另請參閱