Highlight Everything

  • Thread starter Thread starter Altman
  • Start date Start date
A

Altman

I am using 4 numeric up down for a user to enter in an IP address. I would
like it so that upon entering the box, the everything is highlighted in the
box and when they type, it overwrites what is currently in there. How can I
do this. Right now I when I tab into the box I have to backspace the
current value out before putting a new value in.
 
Put code like this in your form somewhere

numericUpDown2.GotFocus += new EventHandler(numericUpDown2_GotFocus);

And in the numericUpDown2_GotFocus, put code that looks like -
numericUpDown2.Select(...,...) ;

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 

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

Back
Top