DataGridViewCell.MeasureTextSize メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
特性を指定して、指定したテキストの高さと幅を取得します。
public:
static System::Drawing::Size MeasureTextSize(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags);
public static System.Drawing.Size MeasureTextSize (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags);
public static System.Drawing.Size MeasureTextSize (System.Drawing.Graphics graphics, string? text, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags);
static member MeasureTextSize : System.Drawing.Graphics * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags -> System.Drawing.Size
Public Shared Function MeasureTextSize (graphics As Graphics, text As String, font As Font, flags As TextFormatFlags) As Size
パラメーター
- text
- String
計測対象のテキスト。
- flags
- TextFormatFlags
テキストに適用される TextFormatFlags 値のビットごとの組み合わせ。
戻り値
テキストの高さと幅を表す Size。
例外
flags
は、TextFormatFlags 値のビットごとの正しい組み合わせではありません。
注釈
複数の行が必要で、指定した書式設定で許可されている場合、返されるサイズにはすべての行の高さが組み合わされます。
適用対象
こちらもご覧ください
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET