Solved

vb.net numericupdown control

Posted on 2009-05-12
2
551 Views
Last Modified: 2012-05-06
I'm using several of these to allow the user to enter different values (both integer & decimal, if it matters).
I'd like the functionality where, once the user tabs or otherwise sets focus on the control, the current value (typically 0 or 0.0) would be highlighted so it could be typed over, without having to remove the 0/0.0 value that's there before typing the new value...
0
Comment
Question by:sirbounty
2 Comments
 
LVL 19

Accepted Solution

by:
Rimvis earned 125 total points
ID: 24371740
Hello sirbounty,

You can use MouseDown and Enter events, like this:


    Private Sub NumericUpDown1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.Enter
        NumericUpDown1.Select(0, NumericUpDown1.Value.ToString().Length)
    End Sub 

    Private Sub NumericUpDown1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NumericUpDown1.MouseDown
        NumericUpDown1.Select(0, NumericUpDown1.Value.ToString().Length)
    End Sub

Open in new window

0
 
LVL 7

Expert Comment

by:meispisces
ID: 24371908
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now