Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

NumericUpDown select contents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Qpeg - 16 Aug 2006 09:01 GMT
I am having a hard time trying to select thet contents of a NumericUpDown
control when it gets focus. When the control gets focus I want all the
contents to be selected so that the user would per default overwrite it when
she enters data.

Basically I overrode OnEnter and did this.Select(0,
this.Value.ToString().Length); (seems a bit cumbersome, but I haven't found a
better way of doing it). Nothing happens.
MSDN documentation states NumericUpDown should have a Text property, I can't
see that it does. It does not have a Selection property either, so if I
needed the actual selected numbers I don't see how I would get that.

When you TAB into the control the contents is selected (as I want it) so I
know this must be possible to do when I select it with the mouse also.

Thanks.
Qpeg - 16 Aug 2006 09:04 GMT
Actually, while debugging I could see that the control has a Text property,
but it does not recognize this in Visual Studio (2005).. Anybody know why?

> I am having a hard time trying to select thet contents of a NumericUpDown
> control when it gets focus. When the control gets focus I want all the
[quoted text clipped - 12 lines]
>
> Thanks.
Qpeg - 16 Aug 2006 10:35 GMT
Found 2 different solutions here:
http://blog.markarteaga.com/CommentView,guid,85271d7d-14a1-41dd-8469-d230a4e609c
f.aspx

The one using the timer seems like the cleanest solution, although I don't
quite understand why it works. Anyone?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.