共用方式為


TreeView.SelectionChanged 事件

定義

發生於 中目前選取 TreeView之項目的變更時。

// Register
event_token SelectionChanged(TypedEventHandler<TreeView, TreeViewSelectionChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void SelectionChanged(event_token const* cookie) const;

// Revoke with event_revoker
TreeView::SelectionChanged_revoker SelectionChanged(auto_revoke_t, TypedEventHandler<TreeView, TreeViewSelectionChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<TreeView,TreeViewSelectionChangedEventArgs> SelectionChanged;
function onSelectionChanged(eventArgs) { /* Your code */ }
treeView.addEventListener("selectionchanged", onSelectionChanged);
treeView.removeEventListener("selectionchanged", onSelectionChanged);
- or -
treeView.onselectionchanged = onSelectionChanged;
Public Custom Event SelectionChanged As TypedEventHandler(Of TreeView, TreeViewSelectionChangedEventArgs) 

事件類型

備註

TreeView.SelectionChanged處理事件,以在控件中TreeView選取的節點集由使用者或以程式設計方式變更時回應。 TreeView控件會引發此事件以回應選取變更,這會對應至 TreeView.SelectedItem、TreeView.SelectedItemsTreeView.SelectedNodes 屬性中的變更。

適用於