DataGridViewTopLeftHeaderCell.GetPreferredSize(Graphics, DataGridViewCellStyle, Int32, Size) Metodo

Definizione

Calcola le dimensioni preferenziali, in pixel, della cella.Calculates the preferred size, in pixels, of the cell.

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

Parametri

graphics
Graphics

Oggetto Graphics usato per disegnare la cella.The Graphics used to draw the cell.

cellStyle
DataGridViewCellStyle

Oggetto DataGridViewCellStyle che rappresenta lo stile della cella.A DataGridViewCellStyle that represents the style of the cell.

rowIndex
Int32

Indice in base zero della riga della cella.The zero-based row index of the cell.

constraintSize
Size

Dimensioni massime della cella consentite.The cell's maximum allowable size.

Restituisce

Size

Oggetto Size che rappresenta le dimensioni preferenziali, in pixel, della cella.A Size that represents the preferred size, in pixels, of the cell.

Eccezioni

rowIndex è diverso da -1.rowIndex does not equal -1.

Commenti

Questo metodo si basa sul DataGridViewCell.GetFormattedValue metodo.This method relies on the DataGridViewCell.GetFormattedValue method.

Si applica a

Vedi anche