TabControlEventArgs 클래스
업데이트: 2007년 11월
TabControl 컨트롤의 Selected 및 Deselected 이벤트에 대한 데이터를 제공합니다.
어셈블리: System.Windows.Forms(System.Windows.Forms.dll)
Action 속성을 사용하여 발생한 이벤트를 확인합니다. 이를 통해 한 이벤트 처리기에서 여러 이벤트 형식을 처리할 수 있습니다.
TabPage 및 TabPageIndex 속성을 사용하여 이벤트가 발생한 TabPage를 확인합니다.
이벤트 처리에 대한 자세한 내용은 이벤트 사용을 참조하십시오.
다음 코드 예제에서는 이 형식을 사용하는 방법을 보여 줍니다. 이 예제에서 이벤트 처리기는 Selected 이벤트가 발생할 때 보고합니다. 이 보고서를 사용하면 이벤트가 발생하는 경우를 이해할 수 있으며 보다 원활하게 디버깅 작업을 수행할 수 있습니다. 자주 발생하는 이벤트 또는 여러 이벤트를 보고하려면 Show를 Console.WriteLine으로 바꾸거나 여러 줄로 구성된 TextBox에 메시지를 추가합니다.
예제 코드를 실행하려면 TabControl1이라는 TabControl 형식의 인스턴스가 있는 프로젝트에 해당 코드를 붙여넣습니다. 그런 다음 이벤트 처리기가 Selected 이벤트와 연결되어 있는지 확인합니다.
private void TabControl1_Selected(Object sender, TabControlEventArgs e) { System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder(); messageBoxCS.AppendFormat("{0} = {1}", "TabPage", e.TabPage ); messageBoxCS.AppendLine(); messageBoxCS.AppendFormat("{0} = {1}", "TabPageIndex", e.TabPageIndex ); messageBoxCS.AppendLine(); messageBoxCS.AppendFormat("{0} = {1}", "Action", e.Action ); messageBoxCS.AppendLine(); MessageBox.Show(messageBoxCS.ToString(), "Selected Event" ); }
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.