Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bold, Italic.....

Status
Not open for further replies.

paulvdw

Programmer
Jan 9, 2004
13
BE
Hello all,

In the following character string " My name is James Brown" I want to have the name 'Brown' in bold or italic. Is ther a function like upper() or how to manage it?

Regards

Paul
 
Where you want to put that string?
No way with VFP native controls. You must use RichText Edit controls to do this.

Borislav Borissov
 

Paul,

You must either use an ActiveX control (such as the Rich Text control suggested by Borislav), or break the string into multiple controls. For example, you could create two labels, one containing "My name is" and the other "Brown". Then you would set the second label's FontBold to .T.

I know this is a bit clumsy, but the fact is that the VFP native control's only have one set of formatting properties.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Similar to Mike's suggestion above I have used the following approach within VFP Reports.

Note, as Mike says - it is clumsy, but it works.

On the VFP Report Form I place a fixed Text string with a Normal Font
"My name is "

Then just at the end of that text string I place variable Textbox which will use a BOLD Font. The variable holds the person's name.
Joe Brown

NOTE - mixing Normal Font & BOLD Font in this manner may result in some un-expected text placements when the document finally prints out. Make a lot of preliminary tests using Preview mode to get the Left/Right placement of the TextBox where you want it to be.

Once done, the end result is
My name is Joe Brown

Good Luck,
JRB-Bldr
 
Hello all,


Thanks but the ituation is too complex, I really need a function: bold(), italic(), fontsice()....
Perhaps for VFP10?

regards


Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top