語言

DataGridViewColumnHeaderCell.GetInheritedStyle 方法

定義

這樣才能把風格套用到細胞上。

public:
 override System::Windows::Forms::DataGridViewCellStyle ^ GetInheritedStyle(System::Windows::Forms::DataGridViewCellStyle ^ inheritedCellStyle, int rowIndex, bool includeColors);
public override System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors);
public override System.Windows.Forms.DataGridViewCellStyle GetInheritedStyle(System.Windows.Forms.DataGridViewCellStyle? inheritedCellStyle, int rowIndex, bool includeColors);
override this.GetInheritedStyle : System.Windows.Forms.DataGridViewCellStyle * int * bool -> System.Windows.Forms.DataGridViewCellStyle
Public Overrides 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及 繼承的儲存格風格設定。

例外狀況

rowIndex 不是 -1。

備註

此方法回傳 , DataGridViewCellStyle 繼承自 DataGridViewCellStyle 與 屬性所回 ColumnHeadersDefaultCellStyleDefaultCellStyleDataGridView傳的物件設定。 如需詳細資訊,請參閱 Windows Forms DataGridView 控制項中的儲存格樣式。

適用於

另請參閱