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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Common Dialog ShowFont feature .. 1

Status
Not open for further replies.

sm43

Programmer
Joined
Dec 1, 2002
Messages
155
Location
US



Hi,
I'm using the ShowFont feature of CommonDialog in VB 6.

I have a Rich text box called RTB1


With comDlg1
.DialogTitle = "Font" 'set the dialog title
.Flags = cdlCFBoth
.ShowFont
End With

RTB1.SelFontName = comDlg1.FontName
RTB1.SelFontSize = comDlg1.FontSize
RTB1.SelBold = comDlg1.FontBold
RTB1.SelItalic = comDlg1.FontItalic
RTB1.SelStrikeThru = comDlg1.FontStrikethru
RTB1.SelUnderline = comDlg1.FontUnderline


When I select a font from the box and hit ok - I don't see the font change in the Rich Text Box (for e.g, the font size) .. I step through the code and the .SetFontName , .SelFontSize etc properties of the Rich Text box are getting set from comDlg1 ... but there're no visible changes to the font..


Appreciate any help - thanks.
Saad
 
RTB1 Sel properties only affect that text which is actually selected. If you want to change font etc for the whole box set SelStart to 1 and SelLength to text length before using the other Sel properties

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 

I want the visual basic program to remember which text in the RTB has what Font selection - so that when it opens next time - the appropriate font is used. I'm saving the text in an Access database file. How do I remember the font selection - it can be different font for different text - so I would have to do a character-to-font mapping.


Saad
 
Can you not just save the rich text in the database?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top