Font Size in Text box

J

Jonesgj

Hi all,

Simple one I'm sure... How can I change the size of font used in textbox at
runtime?

Jonesgj
 
C

Cor

Hi Jonesqj,

I learn you a trick.

You change it in the designer and then you look what code it has generated
in the designer generated code part.

You copy that to your program and change it as you wish.

(To change the font is a little but much code)

I hope this helps?

Cor
 
A

AirPete

Jonesgj said:
Hi all,

Simple one I'm sure... How can I change the size of font used in
textbox at runtime?

Jonesgj

textBox.Font = new Font(textBox.Font.FontFamily, newSize,
textBox.Font.Style);
You may need to use a slightly different constructor if you need more
options.

- Pete
 
H

Herfried K. Wagner [MVP]

* "Jonesgj said:
Simple one I'm sure... How can I change the size of font used in textbox at
runtime?

\\\
Me.TextBox1.Font = New Font("Times New Roman", 22)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top