DataGridBoolColumn.GetPreferredSize(Graphics, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the optimum width and height of a cell given a specific value to contain.
protected public:
override System::Drawing::Size GetPreferredSize(System::Drawing::Graphics ^ g, System::Object ^ value);
protected internal override System.Drawing.Size GetPreferredSize (System.Drawing.Graphics g, object value);
override this.GetPreferredSize : System.Drawing.Graphics * obj -> System.Drawing.Size
Protected Friend Overrides Function GetPreferredSize (g As Graphics, value As Object) As Size
Parameters
- value
- Object
The value that must fit in the cell.
Returns
A Size that contains the drawing information for the cell.
Remarks
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.
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應