TreeNode TreeNode TreeNode TreeNode Class

定義

表示 TreeView 的節點。Represents a node of a TreeView.

public ref class TreeNode : MarshalByRefObject, ICloneable, System::Runtime::Serialization::ISerializable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeNodeConverter))]
[System.Serializable]
public class TreeNode : MarshalByRefObject, ICloneable, System.Runtime.Serialization.ISerializable
type TreeNode = class
    inherit MarshalByRefObject
    interface ICloneable
    interface ISerializable
Public Class TreeNode
Inherits MarshalByRefObject
Implements ICloneable, ISerializable
繼承
衍生
屬性
實作

範例

下列程式碼範例會在TreeView控制項中顯示客戶資訊。The following code example displays customer information in a TreeView control. 根樹狀節點會顯示客戶名稱,而子樹狀節點則會顯示指派給每個客戶的訂單號碼。The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. 在此範例中,1000客戶會以15個訂單顯示。In this example, 1,000 customers are displayed with 15 orders each. TreeView TreeNode Cursor使用和方法會TreeView隱藏的重新繪製,而且會在建立和繪製物件時顯示等候。 EndUpdate BeginUpdateThe repainting of the TreeView is suppressed by using the BeginUpdate and EndUpdate methods, and a wait Cursor is displayed while the TreeView creates and paints the TreeNode objects. 這個範例需要您擁有Customer可保存Order物件集合的物件。This example requires that you have a Customer object that can hold a collection of Order objects. 此外,您也需要在TreeView Form上建立控制項的實例。It also requires that you have created an instance of a TreeView control on a Form.

// The basic Customer class.
ref class Customer: public System::Object
{
private:
   String^ custName;

protected:
   ArrayList^ custOrders;

public:
   Customer( String^ customername )
   {
      custName = "";
      custOrders = gcnew ArrayList;
      this->custName = customername;
   }


   property String^ CustomerName 
   {
      String^ get()
      {
         return this->custName;
      }

      void set( String^ value )
      {
         this->custName = value;
      }

   }

   property ArrayList^ CustomerOrders 
   {
      ArrayList^ get()
      {
         return this->custOrders;
      }

   }

};


// End Customer class
// The basic customer Order class.
ref class Order: public System::Object
{
private:
   String^ ordID;

public:
   Order( String^ orderid )
   {
      ordID = "";
      this->ordID = orderid;
   }


   property String^ OrderID 
   {
      String^ get()
      {
         return this->ordID;
      }

      void set( String^ value )
      {
         this->ordID = value;
      }

   }

};
// End Order class



void FillMyTreeView()
{
   // Add customers to the ArrayList of Customer objects.
   for ( int x = 0; x < 1000; x++ )
   {
      customerArray->Add( gcnew Customer( "Customer " + x ) );
   }
   
   // Add orders to each Customer object in the ArrayList.
   IEnumerator^ myEnum = customerArray->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Customer^ customer1 = safe_cast<Customer^>(myEnum->Current);
      for ( int y = 0; y < 15; y++ )
      {
         customer1->CustomerOrders->Add( gcnew Order( "Order " + y ) );
      }
   }

   // Display a wait cursor while the TreeNodes are being created.
   ::Cursor::Current = gcnew System::Windows::Forms::Cursor( "MyWait.cur" );
   
   // Suppress repainting the TreeView until all the objects have been created.
   treeView1->BeginUpdate();
   
   // Clear the TreeView each time the method is called.
   treeView1->Nodes->Clear();
   
   // Add a root TreeNode for each Customer object in the ArrayList.
   myEnum = customerArray->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Customer^ customer2 = safe_cast<Customer^>(myEnum->Current);
      treeView1->Nodes->Add( gcnew TreeNode( customer2->CustomerName ) );
      
      // Add a child treenode for each Order object in the current Customer object.
      IEnumerator^ myEnum = customer2->CustomerOrders->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         Order^ order1 = safe_cast<Order^>(myEnum->Current);
         treeView1->Nodes[ customerArray->IndexOf( customer2 ) ]->Nodes->Add( gcnew TreeNode( customer2->CustomerName + "." + order1->OrderID ) );
      }
   }
   
   // Reset the cursor to the default for all controls.
   ::Cursor::Current = Cursors::Default;
   
   // Begin repainting the TreeView.
   treeView1->EndUpdate();
}

// The basic Customer class.
public class Customer : System.Object
{
   private string custName = "";
   protected ArrayList custOrders = new ArrayList();

   public Customer(string customername)
   {
      this.custName = customername;
   }

   public string CustomerName
   {      
      get{return this.custName;}
      set{this.custName = value;}
   }

   public ArrayList CustomerOrders 
   {
      get{return this.custOrders;}
   }

} // End Customer class 


// The basic customer Order class.
public class Order : System.Object
{
   private string ordID = "";

   public Order(string orderid)
   {
      this.ordID = orderid;
   }

   public string OrderID
   {      
      get{return this.ordID;}
      set{this.ordID = value;}
   }

} // End Order class

// Create a new ArrayList to hold the Customer objects.
private ArrayList customerArray = new ArrayList(); 

private void FillMyTreeView()
{
   // Add customers to the ArrayList of Customer objects.
   for(int x=0; x<1000; x++)
   {
      customerArray.Add(new Customer("Customer" + x.ToString()));
   }

   // Add orders to each Customer object in the ArrayList.
   foreach(Customer customer1 in customerArray)
   {
      for(int y=0; y<15; y++)
      {
         customer1.CustomerOrders.Add(new Order("Order" + y.ToString()));    
      }
   }

   // Display a wait cursor while the TreeNodes are being created.
   Cursor.Current = new Cursor("MyWait.cur");
        
   // Suppress repainting the TreeView until all the objects have been created.
   treeView1.BeginUpdate();

   // Clear the TreeView each time the method is called.
   treeView1.Nodes.Clear();

   // Add a root TreeNode for each Customer object in the ArrayList.
   foreach(Customer customer2 in customerArray)
   {
      treeView1.Nodes.Add(new TreeNode(customer2.CustomerName));
          
      // Add a child treenode for each Order object in the current Customer object.
      foreach(Order order1 in customer2.CustomerOrders)
      {
         treeView1.Nodes[customerArray.IndexOf(customer2)].Nodes.Add(
           new TreeNode(customer2.CustomerName + "." + order1.OrderID));
      }
   }

   // Reset the cursor to the default for all controls.
   Cursor.Current = Cursors.Default;

   // Begin repainting the TreeView.
   treeView1.EndUpdate();
}
Public Class Customer
   Inherits [Object]
   Private custName As String = ""
   Friend custOrders As New ArrayList()

   Public Sub New(ByVal customername As String)
      Me.custName = customername
   End Sub

   Public Property CustomerName() As String
      Get
         Return Me.custName
      End Get
      Set(ByVal Value As String)
         Me.custName = Value
      End Set
   End Property

   Public ReadOnly Property CustomerOrders() As ArrayList
      Get
         Return Me.custOrders
      End Get
   End Property
End Class 'End Customer class


Public Class Order
   Inherits [Object]
   Private ordID As String

   Public Sub New(ByVal orderid As String)
      Me.ordID = orderid
   End Sub 'New

   Public Property OrderID() As String
      Get
         Return Me.ordID
      End Get
      Set(ByVal Value As String)
         Me.ordID = Value
      End Set
   End Property
End Class ' End Order class

' Create a new ArrayList to hold the Customer objects.
Private customerArray As New ArrayList()

Private Sub FillMyTreeView()
   ' Add customers to the ArrayList of Customer objects.
   Dim x As Integer
   For x = 0 To 999
      customerArray.Add(New Customer("Customer" + x.ToString()))
   Next x

   ' Add orders to each Customer object in the ArrayList.
   Dim customer1 As Customer
   For Each customer1 In customerArray
      Dim y As Integer
      For y = 0 To 14
         customer1.CustomerOrders.Add(New Order("Order" + y.ToString()))
      Next y
   Next customer1

   ' Display a wait cursor while the TreeNodes are being created.
   Cursor.Current = New Cursor("MyWait.cur")

   ' Suppress repainting the TreeView until all the objects have been created.
   treeView1.BeginUpdate()

   ' Clear the TreeView each time the method is called.
   treeView1.Nodes.Clear()

   ' Add a root TreeNode for each Customer object in the ArrayList.
   Dim customer2 As Customer
   For Each customer2 In customerArray
      treeView1.Nodes.Add(New TreeNode(customer2.CustomerName))

      ' Add a child TreeNode for each Order object in the current Customer object.
      Dim order1 As Order
      For Each order1 In customer2.CustomerOrders
         treeView1.Nodes(customerArray.IndexOf(customer2)).Nodes.Add( _
    New TreeNode(customer2.CustomerName + "." + order1.OrderID))
      Next order1
   Next customer2

   ' Reset the cursor to the default for all controls.
   Cursor.Current = System.Windows.Forms.Cursors.Default

   ' Begin repainting the TreeView.
   treeView1.EndUpdate()
End Sub 'FillMyTreeView

備註

集合包含指派給目前TreeNodeTreeNode所有子物件。 NodesThe Nodes collection holds all the child TreeNode objects assigned to the current TreeNode. 您可以新增、移除或複製TreeNode; 當您這麼做時,會新增、移除或複製所有子樹狀節點。You can add, remove, or clone a TreeNode; when you do this, all child tree nodes are added, removed, or cloned. TreeNode個都可以包含其他TreeNode物件的集合。Each TreeNode can contain a collection of other TreeNode objects. 這可能會讓您在逐一查看集合時,很TreeView難以判斷您在中的所在位置。This can make it difficult to determine where you are in the TreeView when iterating through the collection. 若要判斷樹狀結構中的位置,請使用FullPath屬性。To determine your location in a tree structure, use the FullPath property. 您可以使用字串值來剖析FullPath字串,以判斷標籤開始和TreeNode結束 PathSeparator的位置。The FullPath string can be parsed using the PathSeparator string value to determine where a TreeNode label begins and ends.

標籤是藉由明確Text設定屬性來設定。 TreeNodeThe TreeNode label is set by setting the Text property explicitly. 替代方式是使用其中一個具有字串參數( TreeNode Text代表屬性)的其中一個函式來建立樹狀節點。The alternative is to create the tree node using one of the TreeNode constructors that has a string parameter that represents the Text property. 標籤會顯示在TreeNode影像旁(如果有顯示)。The label is displayed next to the TreeNode image, if one is displayed.

若要在樹狀節點旁顯示影像,請將ImageList指派給ImageList ImageTreeView控制項的屬性,並藉由參考ImageList屬性中的索引值來指派。To display images next to the tree nodes, assign an ImageList to the ImageList property of the parent TreeView control and assign an Image by referencing its index value in the ImageList property. 當處於未選取狀態時,將Image 屬性設定為您想要顯示之的索引值。ImageIndex TreeNodeSet the ImageIndex property to the index value of the Image you want to display when the TreeNode is in an unselected state. 同樣地,在SelectedImageIndex選取時TreeNode ,將屬性設定為Image您想要顯示之的索引值。Likewise, set the SelectedImageIndex property to the index value of the Image you want to display when the TreeNode is selected.

您可以使用下列屬性值來選取Nodes特定樹狀節點並逐一查看集合LastNodeFirstNode、、 NextNodePrevNode NextVisibleNode、、 PrevVisibleNodeSelecting specific tree nodes and iterating through the Nodes collection can be achieved by using the following property values: FirstNode, LastNode, NextNode, PrevNode, NextVisibleNode, PrevVisibleNode. 將其中TreeNode一個前述屬性TreeView.SelectedNode所傳回的指派給屬性,以選取TreeView控制項中的樹狀節點。Assign the TreeNode returned by one of aforementioned properties to the TreeView.SelectedNode property to select that tree node in the TreeView control.

樹狀節點可以展開,以顯示下一個層級的子樹狀節點。Tree nodes can be expanded to display the next level of child tree nodes. 使用者可以藉TreeNode由按下TreeNode的加號(+)按鈕(如果有顯示)來展開, TreeNode或者您可以藉由呼叫Expand方法來展開。The user can expand the TreeNode by pressing the plus (+) button next to the TreeNode, if one is displayed, or you can expand the TreeNode by calling the Expand method. 若要展開Nodes集合中的所有子樹狀節點層級, ExpandAll請呼叫方法。To expand all child tree node levels in the Nodes collection, call the ExpandAll method. 您可以藉由TreeNode Collapse呼叫方法來折迭子層級,或使用者可以按下的TreeNode減號(-)按鈕(如果有顯示的話)。You can collapse the child TreeNode level by calling the Collapse method, or the user can press the minus (-) button next to the TreeNode, if one is displayed. 您也可以呼叫Toggle方法,以在展開和折TreeNode迭的狀態之間替代。You can also call the Toggle method to alternate the TreeNode between the expanded and collapsed states.

樹狀節點可以選擇性地顯示覆選框。Tree nodes can optionally display a check box. 若要顯示覆選框,請將CheckBoxes的屬性TreeView設定為trueTo display the check boxes, set the CheckBoxes property of the TreeView to true. 針對處於已核取true狀態的樹狀節點,屬性會設定為。CheckedThe Checked property is set to true for tree nodes that are in a checked state.

建構函式

TreeNode() TreeNode() TreeNode() TreeNode()

初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class.

TreeNode(SerializationInfo, StreamingContext) TreeNode(SerializationInfo, StreamingContext) TreeNode(SerializationInfo, StreamingContext) TreeNode(SerializationInfo, StreamingContext)

使用指定的序列化資訊和內容 (Context),初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class using the specified serialization information and context.

TreeNode(String) TreeNode(String) TreeNode(String) TreeNode(String)

使用指定的標籤文字,初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class with the specified label text.

TreeNode(String, Int32, Int32) TreeNode(String, Int32, Int32) TreeNode(String, Int32, Int32) TreeNode(String, Int32, Int32)

使用指定的標籤文字和當樹狀節點處於選取或未選取狀態時所顯示的影像,初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class with the specified label text and images to display when the tree node is in a selected and unselected state.

TreeNode(String, Int32, Int32, TreeNode[]) TreeNode(String, Int32, Int32, TreeNode[]) TreeNode(String, Int32, Int32, TreeNode[]) TreeNode(String, Int32, Int32, TreeNode[])

使用指定的標籤文字、子樹狀節點和當樹狀節點處於選取和未選取狀態時所顯示的影像,來初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state.

TreeNode(String, TreeNode[]) TreeNode(String, TreeNode[]) TreeNode(String, TreeNode[]) TreeNode(String, TreeNode[])

使用指定的標籤文字和子樹狀節點,初始化 TreeNode 類別的新執行個體。Initializes a new instance of the TreeNode class with the specified label text and child tree nodes.

屬性

BackColor BackColor BackColor BackColor

取得或設定樹狀節點的背景色彩。Gets or sets the background color of the tree node.

Bounds Bounds Bounds Bounds

取得樹狀節點的界限。Gets the bounds of the tree node.

Checked Checked Checked Checked

取得或設定值,指出樹狀節點是否處於核取狀態。Gets or sets a value indicating whether the tree node is in a checked state.

ContextMenu ContextMenu ContextMenu ContextMenu

取得與這個樹狀節點關聯的捷徑功能表。Gets the shortcut menu that is associated with this tree node.

ContextMenuStrip ContextMenuStrip ContextMenuStrip ContextMenuStrip

取得或設定與這個樹狀節點關聯的捷徑功能表。Gets or sets the shortcut menu associated with this tree node.

FirstNode FirstNode FirstNode FirstNode

取得樹狀節點集合的第一個子樹狀節點。Gets the first child tree node in the tree node collection.

ForeColor ForeColor ForeColor ForeColor

取得或設定樹狀節點的前景色彩。Gets or sets the foreground color of the tree node.

FullPath FullPath FullPath FullPath

取得從根樹狀節點通往目前樹狀節點的路徑。Gets the path from the root tree node to the current tree node.

Handle Handle Handle Handle

取得樹狀節點的控制代碼。Gets the handle of the tree node.

ImageIndex ImageIndex ImageIndex ImageIndex

取得或設定樹狀節點處於未選取狀態時,顯示影像的影像清單索引值。Gets or sets the image list index value of the image displayed when the tree node is in the unselected state.

ImageKey ImageKey ImageKey ImageKey

取得或設定影像的索引鍵,這個影像會在節點處於未選取狀態時與這個樹狀節點關聯。Gets or sets the key for the image associated with this tree node when the node is in an unselected state.

Index Index Index Index

取得樹狀節點集合中的樹狀節點位置。Gets the position of the tree node in the tree node collection.

IsEditing IsEditing IsEditing IsEditing

取得值,指出樹狀節點是否處於可編輯的狀態。Gets a value indicating whether the tree node is in an editable state.

IsExpanded IsExpanded IsExpanded IsExpanded

取得值,指出樹狀節點是否處於展開狀態。Gets a value indicating whether the tree node is in the expanded state.

IsSelected IsSelected IsSelected IsSelected

取得值,指出樹狀節點是否處於選取狀態。Gets a value indicating whether the tree node is in the selected state.

IsVisible IsVisible IsVisible IsVisible

取得值,指出是否可看見整個或部分樹狀節點。Gets a value indicating whether the tree node is visible or partially visible.

LastNode LastNode LastNode LastNode

取得最後一個子樹狀節點。Gets the last child tree node.

Level Level Level Level

取得樹狀節點在 TreeView 控制項中的深度,以零起始。Gets the zero-based depth of the tree node in the TreeView control.

Name Name Name Name

取得或設定樹狀節點的名稱。Gets or sets the name of the tree node.

NextNode NextNode NextNode NextNode

取得下一個同層級 (Sibling) 樹狀節點。Gets the next sibling tree node.

NextVisibleNode NextVisibleNode NextVisibleNode NextVisibleNode

取得下一個可見的樹狀節點。Gets the next visible tree node.

NodeFont NodeFont NodeFont NodeFont

取得或設定用來顯示樹狀節點標籤文字的字型。Gets or sets the font that is used to display the text on the tree node label.

Nodes Nodes Nodes Nodes

取得指派給目前樹狀節點之 TreeNode 物件的集合。Gets the collection of TreeNode objects assigned to the current tree node.

Parent Parent Parent Parent

取得目前樹狀節點的父樹狀節點。Gets the parent tree node of the current tree node.

PrevNode PrevNode PrevNode PrevNode

取得上一個同層級樹狀節點。Gets the previous sibling tree node.

PrevVisibleNode PrevVisibleNode PrevVisibleNode PrevVisibleNode

取得上一個可見樹狀節點。Gets the previous visible tree node.

SelectedImageIndex SelectedImageIndex SelectedImageIndex SelectedImageIndex

取得或設定當樹狀節點處於選取狀態時,顯示影像的影像清單索引值。Gets or sets the image list index value of the image that is displayed when the tree node is in the selected state.

SelectedImageKey SelectedImageKey SelectedImageKey SelectedImageKey

取得或設定影像的索引鍵,這個影像會在樹狀節點處於選取狀態時顯示在樹狀節點中。Gets or sets the key of the image displayed in the tree node when it is in a selected state.

StateImageIndex StateImageIndex StateImageIndex StateImageIndex

取得或設定影像的索引,用於在父代 TreeNodeTreeView 屬性設為 false 時,指示 CheckBoxes 的狀態。Gets or sets the index of the image that is used to indicate the state of the TreeNode when the parent TreeView has its CheckBoxes property set to false.

StateImageKey StateImageKey StateImageKey StateImageKey

取得或設定影像的索引鍵,用於在父代 TreeNodeTreeView 屬性設為 false 時,指示 CheckBoxes 的狀態。Gets or sets the key of the image that is used to indicate the state of the TreeNode when the parent TreeView has its CheckBoxes property set to false.

Tag Tag Tag Tag

取得或設定包含有關樹狀節點資料的物件。Gets or sets the object that contains data about the tree node.

Text Text Text Text

取得或設定樹狀節點標籤中顯示的文字。Gets or sets the text displayed in the label of the tree node.

ToolTipText ToolTipText ToolTipText ToolTipText

取得或設定當滑鼠指標停留在 TreeNode 上時將出現的文字。Gets or sets the text that appears when the mouse pointer hovers over a TreeNode.

TreeView TreeView TreeView TreeView

取得指派給樹狀節點的父樹狀檢視。Gets the parent tree view that the tree node is assigned to.

方法

BeginEdit() BeginEdit() BeginEdit() BeginEdit()

啟始樹狀節點標籤的編輯。Initiates the editing of the tree node label.

Clone() Clone() Clone() Clone()

複製樹狀節點和以這個樹狀節點為根部的整個樹狀子目錄。Copies the tree node and the entire subtree rooted at this tree node.

Collapse() Collapse() Collapse() Collapse()

收合樹狀節點。Collapses the tree node.

Collapse(Boolean) Collapse(Boolean) Collapse(Boolean) Collapse(Boolean)

摺疊 TreeNode 並選擇性地摺疊其子系。Collapses the TreeNode and optionally collapses its children.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Deserialize(SerializationInfo, StreamingContext) Deserialize(SerializationInfo, StreamingContext) Deserialize(SerializationInfo, StreamingContext) Deserialize(SerializationInfo, StreamingContext)

從指定的 TreeNode 載入 SerializationInfo 的狀態。Loads the state of the TreeNode from the specified SerializationInfo.

EndEdit(Boolean) EndEdit(Boolean) EndEdit(Boolean) EndEdit(Boolean)

結束樹狀節點標籤的編輯。Ends the editing of the tree node label.

EnsureVisible() EnsureVisible() EnsureVisible() EnsureVisible()

請確保樹狀節點是可見的,如有必要請展開樹狀節點和捲動樹狀檢視控制項。Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Expand() Expand() Expand() Expand()

展開樹狀節點。Expands the tree node.

ExpandAll() ExpandAll() ExpandAll() ExpandAll()

展開所有子樹狀節點。Expands all the child tree nodes.

FromHandle(TreeView, IntPtr) FromHandle(TreeView, IntPtr) FromHandle(TreeView, IntPtr) FromHandle(TreeView, IntPtr)

傳回具有指定控制代碼和指派給樹狀檢視控制項的樹狀節點。Returns the tree node with the specified handle and assigned to the specified tree view control.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetNodeCount(Boolean) GetNodeCount(Boolean) GetNodeCount(Boolean) GetNodeCount(Boolean)

傳回子樹狀節點的數目。Returns the number of child tree nodes.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
Remove() Remove() Remove() Remove()

從樹狀檢視控制項移除目前的樹狀節點。Removes the current tree node from the tree view control.

Serialize(SerializationInfo, StreamingContext) Serialize(SerializationInfo, StreamingContext) Serialize(SerializationInfo, StreamingContext) Serialize(SerializationInfo, StreamingContext)

TreeNode 的狀態儲存至指定的 SerializationInfoSaves the state of the TreeNode to the specified SerializationInfo.

Toggle() Toggle() Toggle() Toggle()

切換樹狀節點為展開或收合的狀態。Toggles the tree node to either the expanded or collapsed state.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

明確介面實作

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

以序列化 TreeNode 所需的資料,填入序列化資訊物件。Populates a serialization information object with the data needed to serialize the TreeNode.

適用於

另請參閱