PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Edit Control Captions
Edit Control Captions
Started by DT, Jul., 25 2003 1:45 PM - 1 reply
Posted on July, 25 2003 - 1:45 PM
Hi
A couple of issues regarding the caption of Edit Controls
On my form in create mode I highlight mandatory fields by using code as provided on this NG Description..Text=
gPen(iLightRed)+Description..Text
during the form initialisation - works OK
If however as a result of choices made in a combo I need to cancel a number of mandatory highlights I used the c
ode as Description..Text=gPen(iBlack)+Description..Text in 'Row Selection of' - this has no effect on the text which
remains Red
2nd issue is changing the text - using the code
Profit_Percentage..Text = "Gross Profit %" from within a local procedure (or anywhere else) again has no effect
My question - Is this a quirk of Edit control captions as I notice that the Help make little or no mention of being able
to change this by using functions and although I am using it online the gPen seems to relate more to reports
Is it better to dispense with the captions and replace them with static fields or is there a better way I have yet to
discover?
Regards
DT
Posted on August, 01 2003 - 1:27 PM
Hi DT,
A couple of issues regarding the caption of Edit Controls
On my form in create mode I highlight mandatory fields by using code as
provided on this NG Description..Text=gPen(iLightRed)+Description..Text
during the form initialisation - works OK
If however as a result of choices made in a combo I need to cancel a number
of mandatory highlights I used the code as Description..Text=gPen(iBlack)
+Description..Text in 'Row Selection of' - this has no effect on the text
which remains Red

That's because when you do: Description..Text=gPen(iLightRed)+Description..Text
there are some extra characters in the Description..text to make the color.
So if after that you do : Description..Text=gPen(iBlack)+Description..Text
then it is like you do : Description..Text=gPen(iBlack)+gPen(iLightRed)
+Description..Text, and the last gPen(...) wins.
In this case Description..Text=gPen(iBlack)+Description..Text is
working.
2nd issue is changing the text - using the code
Profit_Percentage..Text = "Gross Profit %" from within a local procedure (or
anywhere else) again has no effect

Tried and working fine, so there must be something else wrong ...
Peter

http://www.xs4all.nl/~petervu