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

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

ListView.ColumnWidthChanging イベント

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

列の幅が変更される場合発生します

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

Public Event ColumnWidthChanging As
 ColumnWidthChangingEventHandler
Dim instance As ListView
Dim handler As ColumnWidthChangingEventHandler

AddHandler instance.ColumnWidthChanging, handler
public event ColumnWidthChangingEventHandler ColumnWidthChanging
public:
event ColumnWidthChangingEventHandler^ ColumnWidthChanging {
    void add (ColumnWidthChangingEventHandler^ value);
    void remove (ColumnWidthChangingEventHandler^ value);
}
/** @event */
public void add_ColumnWidthChanging (ColumnWidthChangingEventHandler
 value)

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

ColumnWidthChanging イベント処理するコード例次に示します。この例はまた、ColumnWidthChangingEventArgs.NewWidth メンバCancel メンバ示してます。この例を実行するには、コードWindows フォーム貼り付けます。次にフォームコンストラクタまたは Loadイベント処理メソッドInitializeListView1呼び出します。

Private WithEvents listView1 As
 New ListView()

Private Sub InitializeListView1()

    ' Initialize a ListView in detail view and add some columns.
    listView1.View = View.Details
    listView1.Width = 200
    listView1.Columns.Add("Column1")
    listView1.Columns.Add("Column2")
    Me.Controls.Add(listView1)

End Sub


' Handle the ColumnWidthChangingEvent.
Private Sub listView1_ColumnWidthChanging(ByVal
 sender As Object, _
    ByVal e As ColumnWidthChangingEventArgs)
 _
    Handles listView1.ColumnWidthChanging

    ' Check if the new width is too big or too small.
    If e.NewWidth > 100 OrElse e.NewWidth
 < 5 Then

        ' Cancel the event and inform the user if the new
        ' width does not meet the criteria.
        MessageBox.Show("Column width is too large or too small")
        e.Cancel = True
    End If

End Sub
ListView listView1 = new ListView();
private void InitializeListView1()
{
    // Initialize a ListView in detail view and add some columns.
    listView1.View = View.Details;
    listView1.Width = 200;
    listView1.Columns.Add("Column1");
    listView1.Columns.Add("Column2");

    // Associate a method with the ColumnWidthChangingEvent.
    listView1.ColumnWidthChanging += 
        new ColumnWidthChangingEventHandler(listView1_ColumnWidthChanging);
    this.Controls.Add(listView1);
}
       
// Handle the ColumnWidthChangingEvent.
private void listView1_ColumnWidthChanging(object
 sender,  
    ColumnWidthChangingEventArgs e)
{
    // Check if the new width is too big or too small.
    if (e.NewWidth > 100 || e.NewWidth < 5)
    {
        // Cancel the event and inform the user if the new
        // width does not meet the criteria.
        MessageBox.Show("Column width is too large or too small");
        e.Cancel = true;
    }
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS