DataGridViewCell.GetInheritedStyle 方法

定義

取得套用到儲存格的樣式。

public:
 virtual System::Windows::Forms::DataGridViewCellStyle ^ GetInheritedStyle(System::Windows::Forms::DataGridViewCellStyle ^ inheritedCellStyle, int rowIndex, bool includeColors);
public virtual System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle (System.Windows.Forms.DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors);
public virtual System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle (System.Windows.Forms.DataGridViewCellStyle? inheritedCellStyle, int rowIndex, bool includeColors);
abstract member GetInheritedStyle : System.Windows.Forms.DataGridViewCellStyle * int * bool -> System.Windows.Forms.DataGridViewCellStyle
override this.GetInheritedStyle : System.Windows.Forms.DataGridViewCellStyle * int * bool -> System.Windows.Forms.DataGridViewCellStyle
Public Overridable Function GetInheritedStyle (inheritedCellStyle As DataGridViewCellStyle, rowIndex As Integer, includeColors As Boolean) As DataGridViewCellStyle

參數

inheritedCellStyle
DataGridViewCellStyle

DataGridViewCellStyle 要填入繼承的儲存格樣式。

rowIndex
Int32

儲存格的父資料列索引。

includeColors
Boolean

如果要在傳回的儲存格樣式中包含已繼承的色彩,則為 true;否則為 false

傳回

DataGridViewCellStyle 包含繼承自儲存格的父資料列、資料行和 DataGridView 的儲存格樣式設定。

例外狀況

儲存格沒有相關聯的 DataGridView

-或-

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

rowIndex 小於 0 或是大於或等於父 DataGridView 中的資料列數。

備註

這個方法會傳回 , DataGridViewCellStyleDataGridViewCellStyle 儲存格父資料列、資料行和 DataGridView 的物件繼承其設定。 如需詳細資訊,請參閱Windows Forms DataGridView 控制項中的儲存格樣式

適用於

另請參閱