473,480 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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=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
1 2144
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2380
by: Benny Raymond | last post by:
More problems with this... When I run this code, the main form returns an invalid cast exception as it's executing the line "TreeNode n = (TreeNode) this.Nodes;" Does anyone know what would...
2
21726
by: Wes | last post by:
I have a treeview that I am continually added nodes to. Each time a new node is added I would like to select that node. Is this possible? I have looked at selectedNode, but I don't know how to...
0
1600
by: naija naija | last post by:
Hi All, I'm using the TreView Web Control for my MENU. And the Menu is populated from an XML file below. I want a way in which i can manipulate the XML when i want to manage it without having to...
3
1816
by: markaelkins | last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am basically trying to send an ID variable into sql to return different records. I've searched everywhere and cannot find the...
2
4450
by: bclegg | last post by:
Hi, When I implement the example code it errors with 'No parameterless constructor defined for this object.' experimenting with dim o as object = mytreenode.clone() gives the same error. The...
9
3687
by: vincent90152900 | last post by:
How to pop up different text base on the selected TreeNode? I want to pop up different Text base on the selected TreeNode of the TreeView component. So, I create a TreeView and a ModalPopupExtender....
0
3272
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
7301
by: jmDesktop | last post by:
I am trying to add nodes with keys to my treeview. I can add general nodes without problem with: //create new node TreeNode newNode = new TreeNode(myIdNumber); //create children TreeNode...
1
3262
by: AAaron123 | last post by:
If you see this posted twice - sorry. My news reader showed my first post as "No Longer Available" I have the following in a .css file. The treeNodes behave as if they were "a" elements. ...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.