Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB size font
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:
RichTextBox1.SelectionFont = New Font(ComboBox1.Text,+2)
 
But it doesn't work.
Posted 16-Apr-12 10:18am
Edited 16-Apr-12 10:21am
v4
Comments
SAKryukov at 16-Apr-12 17:09pm
   
What do you mean by "VB" here? Is anything selected?
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 16 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100