I'm using an unbound UltraWinTree. On calling TreeNode.BeginEdit, the whole text is selected. But I want only the first three characters selected.
How can I do this.
Thanks.
Hi,
You can specify the selection inside UltraTree's ControlAdded event by getting the TextBox associated with the Control object used by the event .
private void ultraTree1_ControlAdded(object sender, ControlEventArgs e){ var tb = e.Control as TextBox; if (tb != null) { this.BeginInvoke((Action)(() => { tb.SelectionStart = 0; tb.SelectionLength = 3; })); }}
Please let me know if you need more information.
thanksJosheela
Hello Josheela,
I need an event firing on every TreeNode.BeginEdit. Because sometimes I need another SelectionLength.
thanks
Hansjörg
I was under the impression that we removed the TextBox from UltraTree's Controls collection when the edit mode session ends, thereby causing ControlAdded to fire each time an edit mode session begins, but I was mistaken about that.
I attached a sample that demonstrates a similar approach, using the GotFocus event instead, which does fire each time the control enters edit mode.