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!

How to use the Seltext

Status
Not open for further replies.

Gti

Programmer
Jul 23, 2001
99
PT
I have a common dialog that calls all the parameters of format... Such as: font, size, color, etc
I have been using the seltext but this changes the text to the name of the font... how can i change the selected text to the font that i need?
Kruxty

:0)
 
if i understand correctly you need to change the selected text font

where is the text is it in a label or textbox etc?

lets say it was a textbox
getting the selected text

With txtbox
.SetFocus
.SelText = .text
.SelStart = 0
.SelLength = Len(.text)

End With

assuming as above all the text is selected then just change the font property of txtbox
ie txtbox.font=strfont ' whereas strfont= a string variable containing the name of the font from your common dialog

if you wish to change part of it that would be more difficult. other than using something like a richtext box I am unsure.

hope this helps

sdh
::)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top