共用方式為


DataGridViewCell.HasStyle 屬性

定義

會得到一個表示該屬性是否 Style 已被設定的值。

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

屬性值

true如果Style屬性已被設定;否則,。 false

屬性

備註

取得該財產價值 Style 後,若該財產之前未被存取,則自動實例化一個新的 DataGridViewCellStyle 資產。 因此,你必須使用該 HasStyle 屬性來判斷該 Style 屬性目前是否設定為實 DataGridViewCellStyle 例。 這有助於判斷該屬性回傳 InheritedStyle 的物件屬性中哪些屬性代表專門為該儲存格設定的樣式。

欲了解更多關於儲存格樣式繼承的資訊,請參閱 Windows 表單 DataGridView 控制項中的儲存格樣式。

適用於

另請參閱