DataGridViewCell.GetPreferredSize メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewCell.GetPreferredSize メソッドの意味・解説 

DataGridViewCell.GetPreferredSize メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

セル推奨されるサイズピクセル単位計算します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Protected Overridable Function
 GetPreferredSize ( _
    graphics As Graphics, _
    cellStyle As DataGridViewCellStyle, _
    rowIndex As Integer, _
    constraintSize As Size _
) As Size
Dim graphics As Graphics
Dim cellStyle As DataGridViewCellStyle
Dim rowIndex As Integer
Dim constraintSize As Size
Dim returnValue As Size

returnValue = Me.GetPreferredSize(graphics, cellStyle, rowIndex,
 constraintSize)
protected virtual Size GetPreferredSize (
    Graphics graphics,
    DataGridViewCellStyle cellStyle,
    int rowIndex,
    Size constraintSize
)
protected:
virtual Size GetPreferredSize (
    Graphics^ graphics, 
    DataGridViewCellStyle^ cellStyle, 
    int rowIndex, 
    Size constraintSize
)
protected Size GetPreferredSize (
    Graphics graphics, 
    DataGridViewCellStyle cellStyle, 
    int rowIndex, 
    Size constraintSize
)
protected function GetPreferredSize (
    graphics : Graphics, 
    cellStyle : DataGridViewCellStyle, 
    rowIndex : int, 
    constraintSize : Size
) : Size

パラメータ

graphics

セル描画使用する Graphics

cellStyle

セルスタイルを表す DataGridViewCellStyle。

rowIndex

セルの 0 から始まる行インデックス番号

constraintSize

セル最大許容サイズ

戻り値
セル推奨されるサイズピクセル単位で表す Size

解説解説

基本クラス DataGridViewCell の GetPreferredSize メソッドは、幅と高さが -1 に設定されSize を常に返します。ただし、このメソッドは、派生したセル クラス適切な値を返すようにオーバーライドされます

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewCell クラス
DataGridViewCell メンバ
System.Windows.Forms 名前空間
DataGridView クラス


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridViewCell.GetPreferredSize メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridViewCell.GetPreferredSize メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridViewCell.GetPreferredSize メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGridViewCell.GetPreferredSize メソッド」の関連用語

DataGridViewCell.GetPreferredSize メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewCell.GetPreferredSize メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS