Results 1 to 4 of 4

Thread: Edit mode on a treeview node via code?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Edit mode on a treeview node via code?

    Hi,

    What I would like to do is to sort of copy the behavior of the Windows Explorer when you add a new folder. In Windows Explorer, when you add a new folder via the menu, it adds a new node and names it "New Folder". But, immediately afterwards, it puts it into "Edit" mode so the user can easily assign their own name.

    Is this something that would be accomplished via an API call of some sort on a node in the treeview? I know how to add a new node, but not how to put it in "Edit" mode via code.

    Any help would be greatly appreciated..

    Dan

    Visual Studio 2010

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Try the StartLabelEdit method of the TreeView control.
    VB Code:
    1. TreeView1.Nodes.Add , , , "New Folder"
    2. TreeView1.Nodes(1).Selected = True
    3. TreeView1.StartLabelEdit
    Last edited by MidgetsBro; Oct 10th, 2001 at 10:24 PM.
    <removed by admin>

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    DOH!!! I didn't even see that method... Thanks!

    Visual Studio 2010

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    No prob... we all have our days...
    <removed by admin>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width