P
PeterB
I have a treeview, and use this code to find the first tagged tree node and
make it the selected tree node. All works fine except for that the blue
square that is used to indicate which node is selected is never shown. What
to do?
private void SelectFirstTaggedTreeNode()
{
if( tView.Nodes.Count != 0 )
{
TreeNode tn;
tn = tView.Nodes[0]; // always use first node
// Get last node in the branch
while( tn.Nodes.Count != 0 )
{
tn = tn.Nodes[0];
}
if( tn.Tag != null )
{
tn.Parent.Expand();
tView.SelectedNode = tn;
}
}
}
regards,
Peter
make it the selected tree node. All works fine except for that the blue
square that is used to indicate which node is selected is never shown. What
to do?
private void SelectFirstTaggedTreeNode()
{
if( tView.Nodes.Count != 0 )
{
TreeNode tn;
tn = tView.Nodes[0]; // always use first node
// Get last node in the branch
while( tn.Nodes.Count != 0 )
{
tn = tn.Nodes[0];
}
if( tn.Tag != null )
{
tn.Parent.Expand();
tView.SelectedNode = tn;
}
}
}
regards,
Peter