NumericUpDown select contents

G

Guest

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.
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top