views:

32

answers:

1

Hello, My c# (winForm) app contain dataTree view with context Menu strip, i want to add Menu strip Item at name : New Directory , that when it click i create a new directory on my treeview. The problem is i want to create the dirctory like it done in windows , right-click -->new -> folder. (i want dir appear and i choose her name exactly like win)..

i think this need to do by win API , by i did not to do this/

Thank!

+3  A: 

How's this:

public void CreateNewFolder()
{
   var newNode = myTreeView.Nodes.Add("New Folder");
   newNode.BeginEdit();
}

That add's a new node to the list, and then puts it into label edit mode.

Coding Gorilla
Thank yoo itws working..
liran
Only need to add : myTreeView.LabelEdit = true;
liran