Поделиться через


DataGridViewColumnHeaderCell.GetContentBounds Метод

Определение

Возвращает ограничивающий прямоугольник, который заключает область содержимого ячейки, которая вычисляется с помощью указанного Graphics объекта и стиля ячейки.

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

Параметры

graphics
Graphics

Контекст графики для ячейки.

cellStyle
DataGridViewCellStyle

Применяется DataGridViewCellStyle к ячейке.

rowIndex
Int32

Индекс родительской строки ячейки.

Возвращаемое значение

Значение, ограничивающее Rectangle содержимое ячейки.

Исключения

rowIndex не равно -1.

Комментарии

Размер содержимого ячейки вычисляется динамически при вызове этого метода. Этот метод вызывается внутренне при чтении ContentBounds свойства.

Применяется к

См. также раздел