ISelectionService.SelectionChanged 이벤트
현재 선택이 변경될 경우 발생합니다.
네임스페이스: System.ComponentModel.Design
어셈블리: System(system.dll)
구문
‘선언
Event SelectionChanged As EventHandler
‘사용 방법
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에서는 이벤트를 사용할 수 있지만 새로 선언할 수는 없습니다.
설명
이 이벤트 처리기 내에서 발생한 처리가 폼 디자이너의 전체 성능에 중요한 영향을 미칠 수 있으므로 해당 이벤트를 처리할 때 처리를 최소화합니다.
예제
다음 예제에서는 SelectionChanged 인터페이스를 사용하는 방법을 보여 줍니다.
' 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
플랫폼
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에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
참고 항목
참조
ISelectionService 인터페이스
ISelectionService 멤버
System.ComponentModel.Design 네임스페이스
SelectionChanging
EventHandler