DataGridViewCell.GetPreferredSize Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vypočítá upřednostňovanou velikost buňky v pixelech.
protected:
virtual System::Drawing::Size GetPreferredSize(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex, System::Drawing::Size constraintSize);
protected virtual System.Drawing.Size GetPreferredSize (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex, System.Drawing.Size constraintSize);
abstract member GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -> System.Drawing.Size
override this.GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -> System.Drawing.Size
Protected Overridable Function GetPreferredSize (graphics As Graphics, cellStyle As DataGridViewCellStyle, rowIndex As Integer, constraintSize As Size) As Size
Parametry
- cellStyle
- DataGridViewCellStyle
A DataGridViewCellStyle , který představuje styl buňky.
- rowIndex
- Int32
Index řádku založeného na nule buňky.
- constraintSize
- Size
Maximální povolená velikost buňky.
Návraty
A Size , která představuje upřednostňovanou velikost buňky v pixelech.
Poznámky
Metoda GetPreferredSize v základní třídě DataGridViewCell vždy vrátí šířku Size a výšku -1. Tato metoda je však přepsána v odvozených tříd buněk vrátit správné hodnoty.