>Hi all!
>
>I use TreeView in my form and I want to give users ability to rename nodes either by clicking the node or by pressing appropriate button on my form.
>I also use "BeforeLabelEdit" method of the TreeView to ensure that the clicked node is changeble before user can rename it. This works fine when I click the node but when I press my button, "BeforeLabelEdit" method just isn't called. I use the following syntax in my button's Click Event:
> MyForm.MyTreeView.StartLabelEdit
>
>I tried to use another syntaxes:
> MyForm.MyTreeView.BeforeLabelEdit
> MyForm.MyTreeView.StartLabelEdit
>or
> MyForm.MyTreeView.Click
>or
> MyForm.MyTreeView.NodeClick(MyForm.MyTreeView.SelectedItem)
>
>but result is the same. It doesn't work.
>
>Maybe who knows what's the trick ?
You could the code in a form method - eg. RenameNode() and have the click event of the button and the BeforeLabelEdit() event of the Treeview both call it.
Cheers,
Jamie