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
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示