Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
600
Selecting only part of text when BeginEdit
posted

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.

Parents
  • 1225
    Offline posted

    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.

    thanks
    Josheela

Reply Children