Results 1 to 2 of 2

Thread: Select Focus

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    I'm trying to write a program that will clear a text box in the following way:

    First you click on the text box and the letters in the textbox become selected. Then, I click on a command button called CLEAR and it will then clear the selected letters in the text box. What is the easiest way to do this?


  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Easy thing
    Code:
    Private Sub Text1_GotFocus()
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1.Text)
    End Sub
    Private Sub Command1_Click()
        Text1.Text = ""
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width