Share via


ISelectionService.SelectionChanged 事件

定義

目前選取範圍變更時發生。

public:
 event EventHandler ^ SelectionChanged;
event EventHandler SelectionChanged;
member this.SelectionChanged : EventHandler 
Event SelectionChanged As EventHandler 

事件類型

範例

下列範例說明如何使用 SelectionChanged 事件。

// Add SelectionChanged event handler to event
m_selectionService->SelectionChanged += gcnew EventHandler( this, &ComponentClass::OnSelectionChanged );
// Add SelectionChanged event handler to event
m_selectionService.SelectionChanged += new EventHandler(OnSelectionChanged);
' Add SelectionChanged event handler to event
AddHandler m_selectionService.SelectionChanged, AddressOf OnSelectionChanged
/* This is the OnSelectionChanged handler method.  This method calls
    OnUserChange to display a message that indicates the name of the
    handler that made the call and the type of the event argument. */
void OnSelectionChanged( Object^ /*sender*/, EventArgs^ args )
{
   OnUserChange( "OnSelectionChanged", args->ToString() );
}
/* This is the OnSelectionChanged handler method.  This method calls
    OnUserChange to display a message that indicates the name of the
    handler that made the call and the type of the event argument. */
private void OnSelectionChanged(object sender, EventArgs args) 
{
    OnUserChange("OnSelectionChanged", args.ToString());
}
' This is the OnSelectionChanged handler method.  This method calls
'  OnUserChange to display a message that indicates the name of the
'  handler that made the call and the type of the event argument. 
Private Sub OnSelectionChanged(ByVal sender As Object, ByVal args As EventArgs)
   OnUserChange("OnSelectionChanged", args.ToString())
End Sub

備註

在處理此事件時將處理最小化,因為此事件處理程式中發生的處理可能會大幅影響表單設計工具的整體效能。

適用於

另請參閱