DataGridBoolColumn::GetPreferredSize Method (Graphics^, Object^)
.NET Framework (current version)
Gets the optimum width and height of a cell given a specific value to contain.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- g
-
Type:
System.Drawing::Graphics^
A Graphics that draws the cell.
- value
-
Type:
System::Object^
The value that must fit in the cell.
The GetPreferredSize method allows you to resize the column based on the value displayed. For example, if a cell contains an especially large value, you can use the GetPreferredSize method to return the optimum size of the cell based on the value. The optimum size takes into account not only the size of the string, but also the font used to display it.
.NET Framework
Available since 1.1
Available since 1.1
Show: