special treenode text?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jianren Lu

    #1

    special treenode text?

    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=Environ ment.GetFolderP ath(Environment .SpecialFolder. DesktopDirector y);
    TreeNode specialTN = new TreeNode(deskTo p, 0, 1);
    treeView1.Nodes .Add(specialTN) ;
    specialTN.Text= "Desktop";

    Jianren
  • Champika Nirosh

    #2
    Re: special treenode text?

    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:150b8982.0 307082137.471b5 3db@posting.goo gle.com...[color=blue]
    > 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[/color]
    deskTop=Environ ment.GetFolderP ath(Environment .SpecialFolder. DesktopDirector y
    );[color=blue]
    > TreeNode specialTN = new TreeNode(deskTo p, 0, 1);
    > treeView1.Nodes .Add(specialTN) ;
    > specialTN.Text= "Desktop";
    >
    > Jianren[/color]


    Comment

    Working...