語言

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 A將被培養出繼承的細胞風格。

rowIndex
Int32

該格子父列的索引。

includeColors
Boolean

true將繼承的顏色納入回歸單元的樣式中;否則,。 false

傳回

DataGridViewCellStyle A 包含從儲存格父列、欄DataGridView及 繼承的儲存格風格設定。

例外狀況

該單元沒有對應 DataGridView的 。

-或-

ColumnIndex 小於 0,表示該儲存格是列標頭儲存格。

rowIndex 小於 0,或大於或等於父 DataGridView節點的列數。

備註

此方法回傳 A DataGridViewCellStyle ,繼承自 DataGridViewCellStyle 細胞父列、列 DataGridView及 的物件設定。 如需詳細資訊,請參閱 Windows Forms DataGridView 控制項中的儲存格樣式。

適用於

另請參閱