I bet you're gonna kick yourself after I show you this one :-)
case frmOpenEvent:
frmP = FrmGetActiveForm();
MainFormInit( frmP);
FrmDrawForm ( frmP);
// Set the focus AFTER you draw your form
FrmSetFocus(frmP, FrmGetObjectIndex(frm, MainResult1Field));
handled = true;
Ciao!
--
Tim Astle
Owen Butler <[EMAIL PROTECTED]> wrote in message
news:8470@palm-dev-forum...
>
> Hello,
>
> Im trying to set the focus to a text entry field in my program,
>
> I was under the impression that
>
> FormPtr frm = FrmGetActiveForm();
> FrmSetFocus(frm, FrmGetObjectIndex(frm, MainResult1Field));
>
> would do the trick... but i've had no success in my program.
>
> I've tried calling FrmSetFocus in my main forms init function, and
directly
> after recieving the frmOpenEvent event.
>
> file://example
> case frmOpenEvent:
> frmP = FrmGetActiveForm();
> MainFormInit( frmP);
> FrmDrawForm ( frmP);
> handled = true;
>
>
> FrmSetFocus(frmP, FrmGetObjectIndex(frmP, MainResult1Field));
> // end example
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html