Click here to Skip to main content
11,430,829 members (77,119 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hello,
I have a very simple ques?
How can I set a default integer value in a textbox, in window form.

Thanks
Posted 16-Jan-13 0:57am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are using integers only, then I wouldn't use a Textbox - it's far too easy for the user to mistype and enter data you have to check and report back to him on.

Why not use a NumericUpDown? It only allows numbers, and you can set a max and min value as well.

If you must use a TextBox, then just set the Text property in either the designer, or the form Load event.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100