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!!!!
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
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!!!!