Announcement

Collapse
No announcement yet.

Selecting text in a TEXTBOX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Selecting text in a TEXTBOX

    Hi,

    I am working on a program that has a number of textboxes. They are loaded from a fixed length string array when the program starts.

    The user will need to edit some (hopefully very little) of the info in the text boxes.

    What I can't seem to find is a way to highlight the entire existing contents of the TEXTBOX control when a user clicks or tabs into it.

    Is there a simple way to do this?

    Ken
    Ken S. Elvehjem
    [email protected]

  • #2
    Code:
     
              CONTROL SEND hdlg,%CtrlID, %EM_SETSEL, 0,-1
    in the %EN_SETFOCUS event for the control in the dialog callback
    Bob Mechler

    Comment


    • #3
      Clicking in the field doesn't seem to trigger it. Tabbing into it shouldn't need any special extra coding.

      Bob Mechler

      Comment


      • #4
        Bob,

        Thanks for the reply... it works just like you said. I wish I knew a way to make it select all the text when I click in the box -- Like the Address bar in IE...

        Sincerely,

        Ken
        Ken S. Elvehjem
        [email protected]

        Comment


        • #5
          Select all the text in each control when you build it; and do not use ES_NOHIDESEL style. Then when control gets focus the selected text(all) will be highlited.
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            use CONTROL POST instead of CONTROL SEND
            see: http://www.powerbasic.com/support/fo...ML/006749.html

            CONTROL POST hdlg,%CtrlID, %EM_SETSEL, 0,-1

            Comment

            Working...
            X