TreeViewAction TreeViewAction TreeViewAction TreeViewAction Enum

정의

TreeViewEventArgs 이벤트를 발생시킨 작업을 지정합니다.Specifies the action that raised a TreeViewEventArgs event.

public enum class TreeViewAction
public enum TreeViewAction
type TreeViewAction = 
Public Enum TreeViewAction
상속
TreeViewActionTreeViewActionTreeViewActionTreeViewAction

필드

ByKeyboard ByKeyboard ByKeyboard ByKeyboard 1

키 입력으로 이벤트가 발생했습니다.The event was caused by a keystroke.

ByMouse ByMouse ByMouse ByMouse 2

마우스 조작으로 이벤트가 발생했습니다.The event was caused by a mouse operation.

Collapse Collapse Collapse Collapse 3

TreeNode 축소로 이벤트가 발생했습니다.The event was caused by the TreeNode collapsing.

Expand Expand Expand Expand 4

TreeNode 확장으로 이벤트가 발생했습니다.The event was caused by the TreeNode expanding.

Unknown Unknown Unknown Unknown 0

이벤트를 발생시킨 작업을 알 수 없습니다.The action that caused the event is unknown.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 TreeView.AfterSelect 이벤트 및 TreeViewAction 열거형입니다.The following code example demonstrates how to use the TreeView.AfterSelect event and the TreeViewAction enumeration. TreeView 컨트롤을 포함 하는 폼에 다음 코드 예제 붙여넣기를 실행 하 라는 TreeView1 합니다.To run the example paste the following code in a form containing a TreeView control named TreeView1. 이 예에서는 가정 TreeView1 항목으로 채워집니다 및 TreeView.AfterSelect 이벤트가 샘플에 정의 된 이벤트 처리 메서드에 연결 되어 있습니다.This example assumes TreeView1 is populated with items and the TreeView.AfterSelect event is connected to the event-handling method defined in the sample.

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(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 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

설명

이 열거형 멤버와 같은 사용 되는 TreeViewEventArgs 생성자입니다.This enumeration is used by members such as the TreeViewEventArgs constructor.

적용 대상

추가 정보