DataGridViewColumnHeaderCell.GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) DataGridViewColumnHeaderCell.GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) DataGridViewColumnHeaderCell.GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) DataGridViewColumnHeaderCell.GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) Method

定义

获取应用于该单元格的样式。Gets the style applied to the cell.

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 DataGridViewCellStyle DataGridViewCellStyle

将使用继承的单元格样式填充的 DataGridViewCellStyleA DataGridViewCellStyle to be populated with the inherited cell style.

rowIndex
Int32 Int32 Int32 Int32

该单元格的父行索引。The index of the cell's parent row.

includeColors
Boolean Boolean Boolean Boolean

如果在返回的单元格样式中包括继承的颜色,则为 true;否则为 falsetrue to include inherited colors in the returned cell style; otherwise, false.

返回

一个 DataGridViewCellStyle,它包括从单元格的父行、父列和父 DataGridView 继承而来的单元格样式设置。A DataGridViewCellStyle that includes the style settings of the cell inherited from the cell's parent row, column, and DataGridView.

异常

注解

此方法返回DataGridViewCellStyle继承其设置从DataGridViewCellStyle返回的对象ColumnHeadersDefaultCellStyleDefaultCellStyle的属性DataGridViewThis method returns a DataGridViewCellStyle that inherits its settings from the DataGridViewCellStyle objects returned by the ColumnHeadersDefaultCellStyle and DefaultCellStyle properties of the DataGridView. 有关详细信息,请参阅Windows 窗体 DataGridView 控件中的单元格样式For more information, see Cell Styles in the Windows Forms DataGridView Control.

适用于

另请参阅