DataGridViewBand.HasDefaultCellStyle DataGridViewBand.HasDefaultCellStyle DataGridViewBand.HasDefaultCellStyle DataGridViewBand.HasDefaultCellStyle Property


取得指出是否已經設定 DefaultCellStyle 屬性的值。Gets a value indicating whether the DefaultCellStyle property has been set.

 property bool HasDefaultCellStyle { bool get(); };
public bool HasDefaultCellStyle { get; }
member this.HasDefaultCellStyle : bool
Public ReadOnly Property HasDefaultCellStyle As Boolean


如果 DefaultCellStyle 屬性已經設定,則為 true,否則為 falsetrue if the DefaultCellStyle property has been set; otherwise, false.


如果先前尚未存取屬性DefaultCellStyle , 則取得屬性的DataGridViewCellStyle值會自動具現化新的。Getting the value of the DefaultCellStyle property automatically instantiates a new DataGridViewCellStyle if the property has not previously been accessed. 因此, 您必須使用HasDefaultCellStyle屬性來判斷DefaultCellStyle屬性目前是否設定為DataGridViewCellStyle實例。You must, therefore, use the HasDefaultCellStyle property to determine whether the DefaultCellStyle property is currently set to a DataGridViewCellStyle instance. 這適用于判斷InheritedStyle屬性所傳回之物件的哪些屬性代表專為該寬線所設定的樣式。This is useful to determine which properties of the object returned by the InheritedStyle property represent styles set specifically for the band.

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