DataGridViewCell.MeasureTextPreferredSize メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
特性を指定して、指定したテキストの最適な高さと幅を取得します。
public:
static System::Drawing::Size MeasureTextPreferredSize(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, float maxRatio, System::Windows::Forms::TextFormatFlags flags);
public static System.Drawing.Size MeasureTextPreferredSize (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, float maxRatio, System.Windows.Forms.TextFormatFlags flags);
static member MeasureTextPreferredSize : System.Drawing.Graphics * string * System.Drawing.Font * single * System.Windows.Forms.TextFormatFlags -> System.Drawing.Size
Public Shared Function MeasureTextPreferredSize (graphics As Graphics, text As String, font As Font, maxRatio As Single, flags As TextFormatFlags) As Size
パラメーター
- text
- String
計測対象のテキスト。
- maxRatio
- Single
テキストのブロックの、最大の幅と高さの比率。
- flags
- TextFormatFlags
テキストに適用される TextFormatFlags 値のビットごとの組み合わせ。
戻り値
テキストの適切な高さと幅を表す Size。
例外
maxRatio
が 0 以下です。
flags
は、TextFormatFlags 値のビットごとの正しい組み合わせではありません。
注釈
複数の行が必要で、指定した書式設定で許可されている場合、返されるサイズには、すべての行の高さの合計が含まれます。