Results 1 to 5 of 5

Thread: TextBox control

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    54

    Question TextBox control

    Hi all,

    anybody can please tell me how to set textBox control to take decimal values.
    decimal point should already be there in text box control .

    thanks

    regards

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: TextBox control

    That would require a MaskedTextbox control instead.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: TextBox control

    MaskedTextbox is in .NET 2.0

    For now, we have this:

    http://msdn.microsoft.com/library/de...bjMaskEdit.asp

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: TextBox control

    The only problem with a mask is that you will generally have to set the number of characters before and after the decimal point. What you may like to do is use a derived TextBox that only accepts numerical values. You can then add a ".0" in the Validating event if the user hasn't entered one. If you follow the "Windows Forms Components" link in my signature you can download a library that includes a NumberBox.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    54

    Re: TextBox control

    Thanks to all of you,
    actually i have downloaded "valitText .dll" but the problem is that user cant reach to the decimal point by pressing "." and while data-entry user cant use arrow keys or any other keys except numeric keys . so it is useless in dataentry type application. and if i have to do some excercise in text changed event, then what is the use of "validText.dll" . i m still using .net 2002, . is there ready to use control which will facilitate all this needs in 2003 or newer version .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width