This documentation is archived and is not being maintained.

TreeNode.IsVisible Property

Gets a value indicating whether the tree node is visible.

[Visual Basic]
Public ReadOnly Property IsVisible As Boolean
public bool IsVisible {get;}
public: __property bool get_IsVisible();
public function get IsVisible() : Boolean;

Property Value

true if the tree node is visible; otherwise, false.


[Visual Basic, C#, C++] The following example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example assumes you have a TreeView control on a Form that contains a collection of TreeNode object, and a Button. There should be enough tree nodes so they are not all visible in the tree view control.

[Visual Basic] 
Private Sub button3_Click(sender As Object, _
  e As System.EventArgs) Handles button3.Click
   Dim lastNode as TreeNode
   lastNode = treeView1.Nodes(treeView1.Nodes.Count - 1). _
     Nodes(treeView1.Nodes(treeView1.Nodes.Count - 1).Nodes.Count - 1)

   If Not lastNode.IsVisible Then
      MessageBox.Show(lastNode.Text & _
        " tree node is visible.")
   End If
End Sub

private void button3_Click(object sender, System.EventArgs e)
   TreeNode lastNode = treeView1.Nodes[treeView1.Nodes.Count - 1].
     Nodes[treeView1.Nodes[treeView1.Nodes.Count - 1].Nodes.Count - 1];

   if (!lastNode.IsVisible)
      MessageBox.Show(lastNode.Text + " tree node is visible.");

    void button3_Click(Object* /*sender*/, System::EventArgs* /*e*/) {
        TreeNode* lastNode = 
            treeView1->Nodes->Item[treeView1->Nodes->Count - 1]->
            Count - 1]->Nodes->Count - 1];

        if (!lastNode->IsVisible) {
                S" tree node is visible."));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

TreeNode Class | TreeNode Members | System.Windows.Forms Namespace | NextVisibleNode | PrevVisibleNode