473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

TreeView label editing

I have a TreeView control which I progmatically (is that a word?) add a node
to the root node BeginEdit() on that node and then want the user to change
the name of it. Exactly as what happens when you right click in explorer and
you create a new folder.

My problem is that even though everything works fine, the label is not
highlighted, so the user has to click inside the editing box of the label,
select the text manually and then type over it.

If they type an incorrect value, I pop up an error box and when they click
ok, the text inside the label is suddenly all selected as I wanted
originally.

My code is as simple as:

tvGroups.LabelEdit = true;
TreeNode newnode = new TreeNode("New Group");
tvGroups.Nodes[0].Nodes.Add(newnode);
newnode.BeginEdit();
The checking of the label contents and working on it are happening in the
AfterLabelEdit routine. How do I get the label to have it's text
automatically selected/highlighted?

Thanks
Nev

Nov 16 '05 #1
0 1570

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
0
by: .pd. | last post by:
I created a Windows form and stuck a toolbar on it with one button. I then added a treeView, docked it to the left of the form and enabled Label Edit. Here's the toolbar button click and after...
0
by: Vladimir Scherbina | last post by:
Hello all. I am trying to edit label in TreeView node, and when I finished editing I need to get the new data, everythings is okay except that fact that I do not get a new data, that have been...
3
by: Steve Richter | last post by:
in windows explorer, the nodes immed under the "my computer" root node appear with a minimum of indenting ( the +/- square is directly underneath the root node ). In the .NET TreeView control the...
1
by: Anil | last post by:
I want to invoke LabelEdit event of TreeView/ListView(property set to true) from another event what should I do? The scenario is like windows explorer. If u click F2, selected node or item will be...
1
by: Sam | last post by:
I'm having problem. I want to have a block of code run, after a user edits the label of a node, so I put the code in the event method of the afterLabelEdit event. The problem is that this code is...
3
by: bob | last post by:
Hello, the nodes in my tree view show a name and then a suffix. I want to be able to edit the name using 'label edit' but I want the suffix to be removed and then added after the edit. I try...
0
by: Robin Tucker | last post by:
I have a tree view which I populate with the titles of nodes, which I then append the number of child nodes to. For example: +Root Of The Tree (2) +Next Level Of The Tree (1) Third Level (0)...
9
by: Tony | last post by:
Hello, In a textbox it is possible set charapters to upper with this property : CharacterCasing = Upper In a treeView not is possible... In Vb i set in a Event form KeyPress --> keyascii =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.