DataGridViewColumnHeaderCell.GetContentBounds Metoda

Definicja

Zwraca prostokąt ograniczenia, który otacza obszar zawartości komórki, który jest obliczany przy użyciu określonego Graphics obiektu i stylu komórki.

protected:
 override System::Drawing::Rectangle GetContentBounds(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex);
protected override System.Drawing.Rectangle GetContentBounds (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex);
override this.GetContentBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -> System.Drawing.Rectangle
Protected Overrides Function GetContentBounds (graphics As Graphics, cellStyle As DataGridViewCellStyle, rowIndex As Integer) As Rectangle

Parametry

graphics
Graphics

Kontekst graficzny komórki.

cellStyle
DataGridViewCellStyle

Element DataGridViewCellStyle , który ma zostać zastosowany do komórki.

rowIndex
Int32

Indeks wiersza nadrzędnego komórki.

Zwraca

Rectangle

Element Rectangle , który jest powiązany z zawartością komórki.

Wyjątki

rowIndex nie jest -1.

Uwagi

Rozmiar zawartości komórki jest obliczany dynamicznie po wywołaniu tej metody. Ta metoda jest wywoływana wewnętrznie, gdy ContentBounds właściwość jest odczytywana.

Dotyczy

Zobacz też