in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Select all text on enter textedit

Last post 9/6/2007 4:49 PM by Marc Greiner [DX-Squad]. 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 9/6/2007 6:05 AM

    Select all text on enter textedit

    hello i want to know if there is a property (or another mean) to select all text when a user enter in a textEdit.

     I try this :

    .....

    MyTextEdit.Enter += new EventHandler(MyTextEdit_Enter);

     ......

    protected virtual void MyTextEdit_Enter(object sender, EventArgs e)

    {

    ((TextEdit)(sender)).SelectAll();

     

    }

    it works fine when you enter by TAB but don't work when you enter with a mouse click.

    (Note : i dont want the text to be selected each time a user do a mouseclik, i can't put this on the click event)

     

    Thx,

    Raphaël

    Filed under:
  • 9/6/2007 4:49 PM In reply to

    Re: Select all text on enter textedit

    Hi Rapha�l;

    Thanks for your question.

    I find your question very interesting, finaly someone bothers about it.

    It so annoying to select text with the mouse on Windows nowadays.

    It is like nobody ever tried to modify an address in the IE address
    toolbar with the mouse, for example.
    Because, if someone ever tries, he will see straight how this was stupidly
    implemented.

    It is not comprehensible why this silly behaviour takes place in the
    DevExpress TextBoxes.

    But here is a solution/workaround:

    Select the text of a textbox on LostFocus (not GotFocus) with SelectAll().
    Select the text when filling/setting the TextBox with new text (with
    SelectAll()).

    This enables what you expect either when the user selects the textBox with
    the keyboard Tab-Key AND with the mouse.

    I honestly do not know why this is not standard, as this used to function
    well in Windows 3.1 !!!!!!!!!

    How does this function on a Mac ?

    You could also have a look at this post where the same discussion took
    place sometime ago:
    http://community.devexpress.com/forums/p/17484/60996.aspx#60996

    Regards,
    Marc Greiner [DX-Squad]
Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED