Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you change color in middle of caption or text?
Message
From
12/10/2001 02:22:44
Antonio Lopes (Online)
BookMARC
Coimbra, Portugal
 
 
To
12/10/2001 01:41:22
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00567417
Message ID:
00567421
Views:
10
>Is there a way to change the color of a few numbers in the middle of a line of text and/or used as a caption?
>
>Example
>
>Print 15 Labels
>
>Have the Print & Labels as normal black, have the 15 as red to stand out.

I see two ways of doing this:

a) use a RTF control;

b) break the label in parts and reposition the third as the second grows or shrinks
label2.left = label1.left+label1.width+nSpacingConstant && might be retrieved from txtwidth(" ",label1.fontname,label1.fontsize)
label2.autosize = .t.
label3.left = label2.left+label2.width+nSpacingConstant && ditto
when label2.caption changes, label3.left should be recalculated

font names, sizes and styles and text colours could be set at design time, in the property sheets, or could even be set at run-time depending on the caption contents


bye
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform