Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have 2 buttons, a font combobox and a richtextbox. I want to increase the font size every time button1 is clicked. Just like in Microsoft Word. I tried with the following code:
VB
RichTextBox1.SelectionFont = New Font(ComboBox1.Text,+2)


But it doesn't work.
Posted
Updated 16-Apr-12 9:21am
v4
Comments
Sergey Alexandrovich Kryukov 16-Apr-12 17:09pm    
What do you mean by "VB" here? Is anything selected?
--SA

1 solution

The question show lack of understanding of the very basics. First, +2 does not increase anything. This is merely an immediate contact, same as 2. First, did you pay attention for the property name: SelectionFont. Did you really wanted to increase the font in selection; or do you want to do it with the whole text? If nothing is selected, nothing can happen.

I don't see any sense in any advice except just one: you could stop developing of any UI and learn very basics of programming. Using, say, console applications and doing the simplest exercises to understand how basic things work: variables, methods, method parameters, classes and their properties: fields, properties and methods. Then — basics of OOP, interfaces, delegates and delegate instance and so on. Without all this stuff, doing any UI development is nearly useless, just a waste of time.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900