I have a gird. One column in that grid is numaric.
I want to allow enter only numaric values to that text boxes. Can I do that
using 'Format' or 'InputMask'
eg:- 325.124
2342
>I have a gird. One column in that grid is numaric.
> I want to allow enter only numaric values to that text boxes. Can I do that using
> 'Format' or 'InputMask'
> eg:- 325.124
> 2342
When yourGrid.Column.ControlSource is a numeric type, VFP
would prevent attempts to type non-digits anyway
CREATE CURSOR temp (test Int)
INSERT INTO temp VALUES (5)
BROWSE NAME oGrid
But as you said, you can use the .Format and .InputMask properties
additionally, say when you want to have a limited length
oGrid.Column1.InputMask = '9999'
hth
-Stefan

Signature
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Marc - 10 Jul 2008 09:52 GMT
Thanks Stefan
Another problem I have.
I have a text field in a form. In that text field I want allow to enter
Numaric and Floats. eg: 22.12, 222
When I set the Textbox .Value to 0 then I can enter numaric values only
can't enter decimal points. If I set the inputmask then the return value of
the Textbox is Character. But I want the textbox return value as Numaric.
Pls Hlp me
>>I have a gird. One column in that grid is numaric.
>> I want to allow enter only numaric values to that text boxes. Can I do
[quoted text clipped - 19 lines]
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
Stefan Wuebbe - 11 Jul 2008 17:55 GMT
> Thanks Stefan
>
[quoted text clipped - 5 lines]
> the Textbox is Character. But I want the textbox return value as Numaric.
> Pls Hlp me
That sounds as if your textbox is not bound to a field and .ControlSource
is probably empty right? In the command window I tried this
_screen.AddObject('Text1','Textbox')
_screen.Text1.Value = 0.00
_screen.Text1.Visible = .T.
which seems to do what you want?
On the other hand, after setting an Inputmask
_screen.Text1.InputMask = '999,999.99'
the VarType(_screen.Text1.Value) was still numeric for me, so I am
not sure whether something is different in your setup?
hth
-Stefan

Signature
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------