Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Underline/bold partial text on a text/edit/label box
Message
From
01/07/1998 15:15:44
 
 
To
30/06/1998 11:10:13
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00112686
Message ID:
00113519
Views:
36
>
>The RTF control is an activeX control which was provided by M$ with VFP50. Its file name is richtx32.ocx. It provides a means of formatting text with italics, underlines, etc. It could be the answer to your problem. There is considerable information in the UT forum about this control -- do a search on "RTF" and one on "Rich Text" which should pull out most of the discussion.
>
>I deal with this situation by using a textbox to display the statements and selectively highlighting the particular words using the .selstart and .sellength properties of the text control. You will probably have to manipulate the .selectedforecolor and .selectedbackcolor properties to get the appearance you want. For example if your text is displayed in the standard black text on a white background, you could set your .selectedforecolor to red so that the highlighted word is red on a white background. In the phrase:
>
> Please select ONE of the following:
>
>.selstart would be set to 15 so that the highlighted section would begin with the "O" in ONE (the 15th character of the string), and .sellength would be 3.
>
>You would also have to disable the control in some fashion, however, so that the user could not actually edit it -- setting .readonly to .T., for example.
>
>However, you could still use my first suggestion, two labels. Even though the source of the label .caption text is a table, the labels could easily be refreshed from a table. For example, label1 = "Please select ONE of the following" and label2 = SUBS(label1,15,3) (= "ONE"). Set .fontunderline of labe2 to .T. and display label2 on top on the ONE in label1. It would take some coding, but it is feasible.
>

I do not have any experience on "Rich Text". I will try it and let you know. Thanks for your advice.

Chu
Previous
Reply
Map
View

Click here to load this message in the networking platform