DataGridView.RowHeightChanged イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridView.RowHeightChanged イベントの意味・解説 

DataGridView.RowHeightChanged イベント

メモ : このイベントは、.NET Framework version 2.0新しく追加されたものです。

行の Height プロパティの値が変更され場合発生します

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

Public Event RowHeightChanged As
 DataGridViewRowEventHandler
Dim instance As DataGridView
Dim handler As DataGridViewRowEventHandler

AddHandler instance.RowHeightChanged, handler
public event DataGridViewRowEventHandler RowHeightChanged
public:
event DataGridViewRowEventHandler^ RowHeightChanged {
    void add (DataGridViewRowEventHandler^ value);
    void remove (DataGridViewRowEventHandler^ value);
}
/** @event */
public void add_RowHeightChanged (DataGridViewRowEventHandler
 value)

/** @event */
public void remove_RowHeightChanged (DataGridViewRowEventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

このイベント使用方法次のコード例示します次の例は「方法 : Windows フォームの DataGridView コントロールの行の外観カスタマイズする」で取り上げている例の一部です。

' Adjusts the padding when the user changes the row height so that 
' the normal cell content is fully displayed and any extra
' height is used for the content that spans multiple columns.
Sub dataGridView1_RowHeightChanged(ByVal sender
 As Object, _
    ByVal e As DataGridViewRowEventArgs) _
    Handles dataGridView1.RowHeightChanged

    ' Calculate the new height of the normal cell content.
    Dim preferredNormalContentHeight As Int32
 = _
        e.Row.GetPreferredHeight(e.Row.Index, _
        DataGridViewAutoSizeRowMode.AllCellsExceptHeader, True)
 - _
        e.Row.DefaultCellStyle.Padding.Bottom()

    ' Specify a new padding.
    Dim newPadding As Padding = e.Row.DefaultCellStyle.Padding
    newPadding.Bottom = e.Row.Height - preferredNormalContentHeight
    e.Row.DefaultCellStyle.Padding = newPadding

End Sub
// Adjusts the padding when the user changes the row height so that
 
// the normal cell content is fully displayed and any extra
// height is used for the content that spans multiple columns.
void dataGridView1_RowHeightChanged(object sender,
    DataGridViewRowEventArgs e)
{
    // Calculate the new height of the normal cell content.
    Int32 preferredNormalContentHeight =
        e.Row.GetPreferredHeight(e.Row.Index, 
        DataGridViewAutoSizeRowMode.AllCellsExceptHeader, true)
 -
        e.Row.DefaultCellStyle.Padding.Bottom;

    // Specify a new padding.
    Padding newPadding = e.Row.DefaultCellStyle.Padding;
    newPadding.Bottom = e.Row.Height - preferredNormalContentHeight;
    e.Row.DefaultCellStyle.Padding = newPadding;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

DataGridView.RowHeightChanged イベントのお隣キーワード
検索ランキング

   

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



DataGridView.RowHeightChanged イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS