ISelectionService.SelectionChanged-Ereignis
Tritt ein, wenn sich die aktuelle Auswahl ändert.
Namespace: System.ComponentModel.Design
Assembly: System (in system.dll)
Syntax
'Declaration
Event SelectionChanged As EventHandler
'Usage
Dim instance As ISelectionService
Dim handler As EventHandler
AddHandler instance.SelectionChanged, handler
event EventHandler SelectionChanged
event EventHandler^ SelectionChanged {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
/** @event */
void add_SelectionChanged (EventHandler value)
/** @event */
void remove_SelectionChanged (EventHandler value)
JScript unterstützt die Verwendung von Ereignissen, aber nicht die Deklaration von neuen Ereignissen.
Hinweise
Verringern Sie die für die Behandlung dieses Ereignisses erforderlichen Verarbeitungsvorgänge, da die Gesamtleistung des Formular-Designers durch die Verarbeitungsprozesse in diesem Ereignishandler erheblich beeinträchtigt werden kann.
Beispiel
Im folgenden Beispiel wird die Verwendung des SelectionChanged-Ereignisses veranschaulicht.
' 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.
Private Sub OnSelectionChanged(ByVal sender As Object, ByVal args As EventArgs)
OnUserChange("OnSelectionChanged", args.ToString())
End Sub 'OnSelectionChanged
// Add SelectionChanged event handler to event
m_selectionService.SelectionChanged += new EventHandler(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. */
private void OnSelectionChanged(object sender, EventArgs args)
{
OnUserChange("OnSelectionChanged", args.ToString());
}
// Add SelectionChanged event handler to event
m_selectionService->SelectionChanged += gcnew EventHandler( this, &ComponentClass::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() );
}
// Add SelectionChanged event handler to event
mSelectionService.add_SelectionChanged(
new EventHandler(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.
*/
private void OnSelectionChanged(Object sender, EventArgs args)
{
OnUserChange("OnSelectionChanged", args.ToString());
} //OnSelectionChanged
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ISelectionService-Schnittstelle
ISelectionService-Member
System.ComponentModel.Design-Namespace
SelectionChanging
EventHandler