Język

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 do wypełnienia dziedziczonego stylu komórki.

rowIndex
Int32

Indeks wiersza nadrzędnego komórki.

includeColors
Boolean

true aby uwzględnić odziedziczone kolory 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 obiekt DataGridViewCellStyle , który dziedziczy jego ustawienia z DataGridViewCellStyle obiektów nadrzędnego wiersza, kolumny i DataGridViewkomórki . Aby uzyskać więcej informacji, zobacz Style komórek w kontrolce DataGridView dla formularzy Windows Forms.

Dotyczy

Zobacz też