다음을 통해 공유


TreeViewAction 열거형

TreeViewEventArgs 이벤트를 발생시킨 작업을 지정합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Enumeration TreeViewAction
‘사용 방법
Dim instance As TreeViewAction
public enum TreeViewAction
public enum class TreeViewAction
public enum TreeViewAction
public enum TreeViewAction

멤버

  멤버 이름 설명
Supported by the .NET Compact Framework ByKeyboard 키 입력으로 이벤트가 발생했습니다. 
Supported by the .NET Compact Framework ByMouse 마우스 조작으로 이벤트가 발생했습니다. 
Supported by the .NET Compact Framework Collapse TreeNode 축소로 이벤트가 발생했습니다. 
Supported by the .NET Compact Framework Expand TreeNode 확장으로 이벤트가 발생했습니다. 
Supported by the .NET Compact Framework Unknown 이벤트를 발생시킨 작업을 알 수 없습니다. 

설명

이 열거형은 TreeViewEventArgs 생성자가 사용합니다.

예제

다음 코드 예제에서는 TreeView.AfterSelect 이벤트와 TreeViewAction 열거형을 사용하는 방법을 보여 줍니다. 이 예제를 실행하려면 TreeView1이라는 이름의 TreeView 컨트롤이 들어 있는 폼에 다음 코드를 붙여넣습니다. 이 예제에서는 TreeView1이 항목으로 채워지고 TreeView.AfterSelect 이벤트가 샘플에 정의된 이벤트 처리 메서드에 연결된다고 가정합니다.

' Handle the After_Select event.
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
    ByVal e As System.Windows.Forms.TreeViewEventArgs) _
        Handles TreeView1.AfterSelect

    ' Vary the response depending on which TreeViewAction
    ' triggered the event. 
    Select Case (e.Action)
        Case TreeViewAction.ByKeyboard
            MessageBox.Show("You like the keyboard!")
        Case TreeViewAction.ByMouse
            MessageBox.Show("You like the mouse!")
    End Select
End Sub
// Handle the After_Select event.
private void TreeView1_AfterSelect(System.Object sender, 
    System.Windows.Forms.TreeViewEventArgs e)
{

    // Vary the response depending on which TreeViewAction
    // triggered the event. 
    switch((e.Action))
    {
        case TreeViewAction.ByKeyboard:
            MessageBox.Show("You like the keyboard!");
            break;
        case TreeViewAction.ByMouse:
            MessageBox.Show("You like the mouse!");
            break;
    }
}
private:
   // Handle the After_Select event.
   void TreeView1_AfterSelect( System::Object^ /*sender*/, System::Windows::Forms::TreeViewEventArgs^ e )
   {
      
      // Vary the response depending on which TreeViewAction
      // triggered the event. 
      switch ( (e->Action) )
      {
         case TreeViewAction::ByKeyboard:
            MessageBox::Show( "You like the keyboard!" );
            break;

         case TreeViewAction::ByMouse:
            MessageBox::Show( "You like the mouse!" );
            break;
      }
   }
// Handle the After_Select event.
private void treeView1_AfterSelect(Object sender,
    System.Windows.Forms.TreeViewEventArgs e)
{
    // Vary the response depending on which TreeViewAction
    // triggered the event. 
    switch (e.get_Action()) {
        case TreeViewAction.ByKeyboard:
            MessageBox.Show("You like the keyboard!");
            break;
        case TreeViewAction.ByMouse:
            MessageBox.Show("You like the mouse!");
            break;
    }
} //treeView1_AfterSelect

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

System.Windows.Forms 네임스페이스
TreeViewEventArgs