Posted by Hal Bonnin on 2000-04-24
> You are able to get just numbers from dialog box controls. You don't need
to
> get a string and then parse it for the number! That is, if you're using
an edit box;
> in which case you'd just set the edit box to "numbers only"(something to
that
you cant get a floating with the edit control set to numbers only. no
decible is accepted. get the onchange for the edit control and check the
last character to see if it is a number or at period.
EditControl.GetWindowText(Buffer,sizeof(Buffer));
if(Buffer[strlen(Buffer)]!='.'||
Buffer[strlen(Buffer)]!='0'||
Buffer[strlen(Buffer)]!='1'||
Buffer[strlen(Buffer)]!='2'||
Buffer[strlen(Buffer)]!='3'||
Buffer[strlen(Buffer)]!='4'||
Buffer[strlen(Buffer)]!='5'||
Buffer[strlen(Buffer)]!='6'||
Buffer[strlen(Buffer)]!='7'||
Buffer[strlen(Buffer)]!='8'||
Buffer[strlen(Buffer)]!='9')
{
Buffer[strlen(Buffer)]='/o';
}
can be used.
Previous post | Next post | Timeline | Home