I need to change text in an rtb using a combo box can anyone help

Watch
This discussion is closed.
Hami374
Badges: 0
#1
Report Thread starter 17 years ago
#1
I am studying Avce ict and need to hand my assignment on friday but i havent put in atext box for font size i have done a type combo box but cant figure out how to make different sizes work. All work is done in Visual basic 6
0
EI_123
Badges: 0
Rep:
?
#2
Report 17 years ago
#2
(Original post by Hami374)
I am studying Avce ict and need to hand my assignment on friday but i havent put in atext box for font size i have done a type combo box but cant figure out how to make different sizes work. All work is done in Visual basic 6
With a Textbox named Text1 and a Combobox named Combo1 you could try this:

Private Sub Combo1_Click()
Text1.FontSize = CInt(Combo1.Text)
End Sub
Attached files
0
EI_123
Badges: 0
Rep:
?
#3
Report 17 years ago
#3
If you are talking about the RichEdit ActiveX control use this line instead:
RichTextBox1.Font.Size = CInt(Combo1.Text)

If you are using Windows API you should use CreateFontIndirect() and SendMessage(WM_SETFONT).
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Would you consider Adjustment if your grades were higher than you expected?

Yes, I'd look at higher ranking universities than my current choices (105)
43.75%
Yes, I'd look for a course or uni that is a better fit for me (39)
16.25%
No, I'd stick with my current uni choice (91)
37.92%
Something else (let us know in the thread below!) (5)
2.08%

Watched Threads

View All