TreeNode::IsVisible Property
.NET Framework (current version)
Gets a value indicating whether the tree node is visible or partially visible.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if the tree node is visible or partially visible; otherwise, false.
The following code 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 requires that you have a TreeView control on a Form that contains a collection of TreeNode objects, and a Button. There should be enough tree nodes so that they are not all visible in the tree view control.
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 ) { lastNode->EnsureVisible(); MessageBox::Show( String::Concat( lastNode->Text, " tree node is visible." ) ); } }
.NET Framework
Available since 1.1
Available since 1.1
Show: