ISelectionService.SelectionChanging 事件

定义

在将要更改当前选择时发生。

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

事件类型

示例

以下示例演示如何使用 SelectionChanging 事件。

// Add SelectionChanging event handler to event
m_selectionService->SelectionChanging += gcnew EventHandler( this, &ComponentClass::OnSelectionChanging );
// Add SelectionChanging event handler to event
m_selectionService.SelectionChanging += new EventHandler(OnSelectionChanging);
' Add SelectionChanging event handler to event
AddHandler m_selectionService.SelectionChanging, AddressOf OnSelectionChanging
/* This is the OnSelectionChanging 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 OnSelectionChanging( Object^ /*sender*/, EventArgs^ args )
{
   OnUserChange( "OnSelectionChanging", args->ToString() );
}
/* This is the OnSelectionChanging 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 OnSelectionChanging(object sender, EventArgs args) 
{
    OnUserChange("OnSelectionChanging", args.ToString());
}
' This is the OnSelectionChanging 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 OnSelectionChanging(ByVal sender As Object, ByVal args As EventArgs)
    OnUserChange("OnSelectionChanging", args.ToString())
 End Sub

注解

在处理此事件时尽量减少处理,因为在此事件处理程序中发生的处理可能会显著影响表单设计器的整体性能。

适用于

另请参阅