DataGridViewCell.GetInheritedStyle Metoda

Definicja

Pobiera styl zastosowany do komórki.

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

Parametry

inheritedCellStyle
DataGridViewCellStyle

Element DataGridViewCellStyle , który ma zostać wypełniony odziedziczonym stylem komórki.

rowIndex
Int32

Indeks wiersza nadrzędnego komórki.

includeColors
Boolean

true do uwzględnienia odziedziczonych kolorów w zwracanym stylu komórki; w przeciwnym razie , false.

Zwraca

Element DataGridViewCellStyle zawierający ustawienia stylu komórki dziedziczone z wiersza nadrzędnego komórki, kolumny i DataGridView.

Wyjątki

Komórka nie ma skojarzonego elementu DataGridView.

-lub-

ColumnIndex wartość jest mniejsza niż 0, co oznacza, że komórka jest komórką nagłówka wiersza.

rowIndex jest mniejsza niż 0 lub większa lub równa liczbie wierszy w obiekcie nadrzędnym DataGridView.

Uwagi

Ta metoda zwraca DataGridViewCellStyle element, który dziedziczy jego ustawienia z DataGridViewCellStyle obiektów wiersza nadrzędnego komórki, kolumny i DataGridView. Aby uzyskać więcej informacji, zobacz Style komórek w kontrolce DataGridView Windows Forms.

Dotyczy

Zobacz też