isnoend2001
asked on
Changing font/size in a richtextbox using vb6
one combo has the available font names
the other the font sizes
After i select Text in the rtf and click out of the rtf it looses focus and nothing gets changed.
Example:
the other the font sizes
After i select Text in the rtf and click out of the rtf it looses focus and nothing gets changed.
Example:
Private Sub cboSize_Click()
rtfLoan.SelFontSize = Val(cboSize.Text)
rtfLoan.SetFocus
End Sub
How to overcome this ?
Can you post a zip file of your project?
Are you aware that you can use a CommonDialog control to change everything about a RichTextbox's font?
Are you aware that you can use a CommonDialog control to change everything about a RichTextbox's font?
With MyCommonDialog
.CancelError = True
.Flags = cdlCFBoth Or cdlCFApply Or cdlCFEffects
.ShowFont
rtbEditor.SelFontName = .FontName
rtbEditor.SelFontSize = .FontSize
rtbEditor.SelItalic = .FontItalic
rtbEditor.SelBold = .FontBold
rtbEditor.SelUnderline = .FontUnderline
rtbEditor.SelStrikeThru = .FontStrikethru
rtbEditor.SelColor = .Color
End With
ASKER
Thanks guys but the problem remains.
Yes I know that the CommonDialog control can be used, but is unneeded and have called the one on the users machine in the past to keep my app small.
Zip is included
-Font-Problem.zip
Yes I know that the CommonDialog control can be used, but is unneeded and have called the one on the users machine in the past to keep my app small.
Zip is included
-Font-Problem.zip
Your Click event is empty! Add the code you posted originally and it will work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, i had it in the change event, for future something else to double check
simple fix
simple fix
You're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
Does this tell you anything?
Open in new window