Click here to Skip to main content
16,006,065 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generallistview control problem Pin
venadder9-Aug-05 16:08
venadder9-Aug-05 16:08 
GeneralRe: listview control problem Pin
Christian Graus9-Aug-05 16:29
protectorChristian Graus9-Aug-05 16:29 
GeneralRe: listview control problem Pin
venadder9-Aug-05 16:33
venadder9-Aug-05 16:33 
GeneralRe: listview control problem Pin
Christian Graus9-Aug-05 16:37
protectorChristian Graus9-Aug-05 16:37 
Generalurgent help with treeview control Pin
BORN...again!9-Aug-05 16:00
BORN...again!9-Aug-05 16:00 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 16:03
protectorChristian Graus9-Aug-05 16:03 
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 16:12
BORN...again!9-Aug-05 16:12 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 16:27
protectorChristian Graus9-Aug-05 16:27 
private void LabelChildNodes(TreeNode node, bool recurse)
{
foreach(TreeNode child in node.Nodes)
{
string count = string.Format(" ({0})", child.Nodes.Count);

child.Text = child.Text + count;

if (recurse)
{
LabelChildNodes(child, recurse);
}
}
}

If you call this function with the first node in your tree view, like this:

LabelChildNodes(treeView1.Nodes[0], true);

you'll get that label all the way down. If you pass 'false', you get it just on the top level. You can also add code to check if the label is there already and remove it, or not show a label if the count is 0, anythign else you'd like.

Christian Graus - Microsoft MVP - C++

P.S. sorry, you'll have to turn this into VB, it's C#.
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 16:41
BORN...again!9-Aug-05 16:41 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 17:05
protectorChristian Graus9-Aug-05 17:05 
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 18:28
BORN...again!9-Aug-05 18:28 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 18:32
protectorChristian Graus9-Aug-05 18:32 
GeneralNeed help!!!!! Pin
DesertWrangler9-Aug-05 13:18
DesertWrangler9-Aug-05 13:18 
GeneralRe: Need help!!!!! Pin
Christian Graus9-Aug-05 14:47
protectorChristian Graus9-Aug-05 14:47 
GeneralRe: Need help!!!!! Pin
DesertWrangler10-Aug-05 10:16
DesertWrangler10-Aug-05 10:16 
GeneralRe: Need help!!!!! Pin
Christian Graus10-Aug-05 10:29
protectorChristian Graus10-Aug-05 10:29 
GeneralRe: Need help!!!!! Pin
DesertWrangler10-Aug-05 10:43
DesertWrangler10-Aug-05 10:43 
GeneralRe: Need help!!!!! Pin
Christian Graus10-Aug-05 11:17
protectorChristian Graus10-Aug-05 11:17 
GeneralRe: Need help!!!!! Pin
dptalt11-Aug-05 5:34
dptalt11-Aug-05 5:34 
Generalscreen size conversion Pin
utservoalius9-Aug-05 13:13
utservoalius9-Aug-05 13:13 
Generalorder by clause in XML Pin
Rizwan Bashir9-Aug-05 10:11
Rizwan Bashir9-Aug-05 10:11 
GeneralGot it Pin
Rizwan Bashir9-Aug-05 10:21
Rizwan Bashir9-Aug-05 10:21 
QuestionHow to modify or extract files from existing MFC application Pin
Zain suri9-Aug-05 10:00
Zain suri9-Aug-05 10:00 
AnswerRe: How to modify or extract files from existing MFC application Pin
Christian Graus9-Aug-05 13:48
protectorChristian Graus9-Aug-05 13:48 
GeneralSending and catching strings from a DLL Pin
Swim-13nrv9-Aug-05 4:30
Swim-13nrv9-Aug-05 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.