Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

Numeric Up/Down Control - Select all text

Hi experts,

I'm using a Numeric Up/Down control and have managed to get the application to select all text when the focus passes to the control at run time.  With normal text boxes this is easily achieved with a .SelectAll function.  With the Numeric Up/Down control I have achieved it using the following code:

        ' Select all text.
        txtTransitionAltitude.Select(0, Len(txtTransitionAltitude.Value))

I now want to have all text selected when I increase of decrease the value using the up/down buttons but cannot get it to work.  I used the above code in the _ValueChanged sub but only a flash of the selection occured when I tried it out.  

Is there another way I can do this?  

Regards,

Ady
0
Ady Foot
Asked:
Ady Foot
1 Solution
 
DjDezmondCommented:
In the design window, goto the _valueChange sub and copy and code into the:

_MouseUp

or

_KeyUp

Event for that control. Your code accesses the value of that control, but when valuechanged is handeled, the value has changed, so it can't reference it. Using on of the above two should work how you need it to.

Dez
0
 
Ady FootSharePoint ConsultantAuthor Commented:
Spot on - thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now