At 10:37 PM -0700 5/26/99, Elia J. Freedman wrote:
>I have a problem. I need to control which field on the screen has focus,
>but the PalmOS keeps taking control from me.
> FrmSetFocus(frmP, FrmGetObjectIndex(frmP, ctlID));
> FldGrabFocus(fldP);
The FldGrabFocus line should be redundant. When you call FrmSetFocus, that
routine itself will call FldGrabFocus. It's important to use the Frm call
because the form has a variable that tracks the current focus--necessary so
that the form can tell the field or table to release the focus if the form
loses/changes focus.
If FrmSetFocus isn't working for you, it's probably because you're calling
it at the wrong time. That is, you probably do set the focus to the field,
but then some other bit of code comes along and sets it to something else.
Tracking this down could be tricky, but I think if you set breakpoints in
your event loop and watch the event flow and which Frm calls get made,
you'll find it.
--Bob
_______________________________________________________________________
Bob Ebert, Sr. Software Engineer, Palm Computing Inc., 3Com Corporation
V: 408 326-9299 5400 Bayfront Plaza, MS: 10212, Santa Clara, CA, 95052
F: 408 326-9891, [EMAIL PROTECTED] (preferred: [EMAIL PROTECTED])