Click here to Skip to main content
12,761,078 members (31,429 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
I have a very simple ques?
How can I set a default integer value in a textbox, in window form.

Posted 16-Jan-13 0:57am

1 solution

Rate this: bad
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.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2017
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