Your resource code is right...but i dunno where u got the codes to insert a text. In 
order for you to do that, you must allocate a TextHandle to a textfield...try this

FormPtr frmP;
int fldLen;
Char Val;   
FieldPtr ValFldP = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, ValField));    

if ((fldLen = FldGetTextLength(ValFldP)) > 0)
   {
    MemHandle TextHandle = FldGetTextHandle(ValFldP);
    StrCopy(Val, MemHandleLock(TextHandle));
                                          
    MemHandleUnlock(TextHandle);
    Val[fldLen] = NULL;
   } 



In a message dated 9/17/2004 3:43:12 PM Eastern Daylight Time, "Keyur Patwa" <[EMAIL 
PROTECTED]> writes:

>
>Hi there,
>
>I have created a form and have a field on it!
>
>Somehow when I open the form, its not showing the cursor or allowing me to
>write anything to field. The field is EDITABLE!
>
>Here is the code i have written to create the field and the init function of
>the form!
>
>FORM ID ValueEntryForm AT (0 0 160 160)
> � �NOSAVEBEHIND NOFRAME
> � �USABLE
>BEGIN
> � �TITLE "******"
> � �LABEL "********" ID 1012 AT (CENTER 50 ) FONT 1
> � �FIELD ID ValField AT (CENTER 70 50 50)
> � � � �EDITABLE
> � � � �UNDERLINED
> � � � �MAXCHARS 10
> � �BUTTON "Back" ID BackButton AT (40 140 AUTO 12)
> � �BUTTON "Send" ID SendButton AT (80 140 AUTO 12)
>END
>
>static void ValueEntryFormInit(FormType *frmP)
>{
> � �UInt16 fieldIndex;
> � �
> � �fieldIndex = FrmGetObjectIndex(frmP, ValField);
> � �
> � �field = (FieldType *)FrmGetObjectPtr(frmP, fieldIndex);
> � �
> � �FldInsert(field, Val, StrLen(Val));
> � �
> � �FrmSetFocus(frmP, fieldIndex);
>}
>
>Please help!
>Thanks,
>Keyur
>
>
>-- 
>For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/support/forums/
>

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to