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

List.ItemCommand イベント

List コントロール関連付けられているコマンドユーザー選択する発生します

名前空間: System.Web.UI.MobileControls
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)
構文構文

Public Event ItemCommand As
 ListCommandEventHandler
Dim instance As List
Dim handler As ListCommandEventHandler

AddHandler instance.ItemCommand, handler
public event ListCommandEventHandler ItemCommand
public:
event ListCommandEventHandler^ ItemCommand {
    void add (ListCommandEventHandler^ value);
    void remove (ListCommandEventHandler^ value);
}
/** @event */
public void add_ItemCommand (ListCommandEventHandler
 value)

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

ItemCommand イベント使用してリスト内の項目のステータス変更しステータス合計再計算するメソッド呼び出す方法次のコード例示します。このコード例は、List概要取り上げているコード例一部です。

Private Sub Status_ItemCommand(ByVal
 sender As Object, _
    ByVal e As ListCommandEventArgs)

    Const spec As String
 = "You now have {0} tasks done, {1} " & _
        "tasks scheduled, and {2} tasks pending."

    ' Move selection to next status toward 'done'
    Select Case e.ListItem.Value
        Case "scheduled"
            schedCount -= 1
            pendCount += 1
            e.ListItem.Value = "pending"
        Case "pending"
            pendCount -= 1
            doneCount += 1
            e.ListItem.Value = "done"
            
    End Select

    ' Show the status of the current task
    Label1.Text = e.ListItem.Text & " is " &
 _
        e.ListItem.Value

    ' Show current selection counts
    Label2.Text = String.Format(spec, doneCount, _
        schedCount, pendCount)
End Sub
Private Sub Status_ItemCommand(ByVal sender As Object, _
    ByVal e As ListCommandEventArgs)

    Const spec As String = "You now have {0} tasks done, {1} " & _
        "tasks scheduled, and {2} tasks pending."

    ' Move selection to next status toward 'done'
    Select Case e.ListItem.Value
        Case "scheduled"
            schedCount -= 1
            pendCount += 1
            e.ListItem.Value = "pending"
        Case "pending"
            pendCount -= 1
            doneCount += 1
            e.ListItem.Value = "done"
            
    End Select

    ' Show the status of the current task
    Label1.Text = e.ListItem.Text & " is " & _
        e.ListItem.Value

    ' Show current selection counts
    Label2.Text = String.Format(spec, doneCount, _
        schedCount, pendCount)
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
List クラス
List メンバ
System.Web.UI.MobileControls 名前空間
Command クラス
CommandEventArgs
ItemCommand
ObjectListCommandEventArgs
OnItemCommand
その他の技術情報
List コントロール概要



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS