Solved

Numeric Up/Down Control - Select all text

Posted on 2006-10-23
2
413 Views
Last Modified: 2008-01-09
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
Comment
Question by:Ady Foot
2 Comments
 
LVL 9

Accepted Solution

by:
DjDezmond earned 125 total points
ID: 17787328
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
 
LVL 16

Author Comment

by:Ady Foot
ID: 17787335
Spot on - thanks!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question