Textbox for Decimal Number


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Textbox for Decimal Number

Hybrid View

  1. #1
    Dante Guest

    Textbox for Decimal Number



    I need a textbox that will accept only numbers (right-justified)
    with fixed decimal places. For example, if the defined decimal
    place is 2, the user cannot enter more than 2 digits after the
    decimal.

    Can anybody help me how to make a user control for this?
    Or is there an available free ocx?

    (A more desirable feature is if I can add a mask for thousand
    separator.)

    Please help!!!!

  2. #2
    Brendan Walsh Guest

    Re: Textbox for Decimal Number


    "Dante" <dantedt@yahoo.com> wrote:
    >
    >
    >I need a textbox that will accept only numbers (right-justified)
    >with fixed decimal places. For example, if the defined decimal
    >place is 2, the user cannot enter more than 2 digits after the
    >decimal.
    >
    >Can anybody help me how to make a user control for this?
    >Or is there an available free ocx?
    >
    >(A more desirable feature is if I can add a mask for thousand
    >separator.)
    >
    >Please help!!!!


    Dante,

    An easy solution is to just use the masked edit control provided free with
    vb. It has some drawbacks, but, will easily do what you've specified. There
    are also hundreds of "for sale" components with a richer object model too.

    Brendan Walsh


  3. #3
    FaisalKhan Guest

    Re: Textbox for Decimal Number


    U can use Format function to display the data according to ur own need,secondly
    u can use ascii values in keypress event,to avoid garbage entries

    "Dante" <dantedt@yahoo.com> wrote:
    >
    >
    >I need a textbox that will accept only numbers (right-justified)
    >with fixed decimal places. For example, if the defined decimal
    >place is 2, the user cannot enter more than 2 digits after the
    >decimal.
    >
    >Can anybody help me how to make a user control for this?
    >Or is there an available free ocx?
    >
    >(A more desirable feature is if I can add a mask for thousand
    >separator.)
    >
    >Please help!!!!



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center