?
Solved

vb.net numericupdown control

Posted on 2009-05-12
2
Medium Priority
?
565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Rimvis earned 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

764 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