Instead of using a label use a field & set it for read-only. The other
method I use is a gadget (to get the coordinates) and have your app use
WinEraseRectangle and WinDrawChar to update the 'label'
I tend to avoid labels if there is a chance I may need to change the text.
-----Original Message-----
From: Marty Rice <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Thursday, April 20, 2000 4:37 PM
Subject: need help using CtlSetLabel()
>In a form's event handler, I'm trying to respond to a control selection by
>changing another control's label (the target is just a label). I copy the
>new string into the control's ::text member and call CtlSetLabel like this:
>
>ControlPtr pCtl = GetObjectPtr(res_id);
>StrCopy(pCtl->text,"new string");
>CtlSetLabel(pCtl,pCtl->text);
>
>This function works fine when called from the form's Init function, but not
>when I call it from the event handler (the string doesn't change at all).
>If I force the entire form to redraw, using FrmDrawForm(), then the new
>string is shown, but if it is shorter than the original string, some of the
>original text is still shown (like it just drew the new string on top of
the
>old one). I've made sure that the string originally defined for the
control
>in Constructor is longer than the string I am copying into it later.
>
>Any advice is appreciated.
>Marty
>
>
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html