Select all in text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dfg

    Select all in text box

    Let's say I have a text box expecting numeric data. Currently If
    invalid data is entered into the box A message box pops up and displays
    a message.

    What I'd like to do is after I click OK on the message box, is to
    highlight the invalid data inside the textbox. How can I do this?

    Thanks.

  • Rick Rothstein

    #2
    Re: Select all in text box

    > Let's say I have a text box expecting numeric data. Currently If[color=blue]
    > invalid data is entered into the box A message box pops up and displays
    > a message.
    >
    > What I'd like to do is after I click OK on the message box, is to
    > highlight the invalid data inside the textbox. How can I do this?[/color]

    Assuming your TextBox is named Text1...

    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)

    Rick - MVP


    Comment

    • dfg

      #3
      Re: Select all in text box

      Rick Rothstein wrote:
      <Snip>[color=blue]
      >
      >
      > Assuming your TextBox is named Text1...
      >
      > Text1.SelStart = 0
      > Text1.SelLength = Len(Text1.Text)
      >
      > Rick - MVP
      >
      >[/color]
      Thanks for the help!

      Comment

      Working...