By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,338 Members | 1,344 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,338 IT Pros & Developers. It's quick & easy.

special treenode text?

P: n/a
Dear all,
I put the PC's desktop to my TreeView list. The code is as
follows. But the text of treenode is too long, I want to just put a
shortname to the treenode, how can I do? if I just put
specialTN.Text="Desktop", it can display such shortname, but DeskTop
can't be open in this case.
string deskTop=Environment.GetFolderPath(Environment.Spec ialFolder.DesktopDirectory);
TreeNode specialTN = new TreeNode(deskTop, 0, 1);
treeView1.Nodes.Add(specialTN);
specialTN.Text="Desktop";

Jianren
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Yes to open the Desktop you need to have the fully qualified path.. So you
better use the TreeNode Tag property to store the real path

Nirosh.

"Jianren Lu" <lu@ils.uec.ac.jp> wrote in message
news:15**************************@posting.google.c om...
Dear all,
I put the PC's desktop to my TreeView list. The code is as
follows. But the text of treenode is too long, I want to just put a
shortname to the treenode, how can I do? if I just put
specialTN.Text="Desktop", it can display such shortname, but DeskTop
can't be open in this case.
string deskTop=Environment.GetFolderPath(Environment.Spec ialFolder.DesktopDirectory
); TreeNode specialTN = new TreeNode(deskTop, 0, 1);
treeView1.Nodes.Add(specialTN);
specialTN.Text="Desktop";

Jianren

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.