By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 2,858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

How to change font size dynamically?

P: n/a
How can I change the font size of a text box dynamically?

I tried this but it didn't work. It said 'Size is Read-Only'. Any other
ways around this? Here's the code:
txtDisplay.Font.Size = 10
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

Dim fnt As Font

fnt = TextBox1.Font

TextBox1.Font = New Font(fnt.Name, 12, FontStyle.Bold)

Ken

------------------------

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
How can I change the font size of a text box dynamically?

I tried this but it didn't work. It said 'Size is Read-Only'. Any other
ways around this? Here's the code:
txtDisplay.Font.Size = 10

Nov 20 '05 #2

P: n/a
Thanks - works great!

"Ken Tucker" <vb***@bellsouth.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

Dim fnt As Font

fnt = TextBox1.Font

TextBox1.Font = New Font(fnt.Name, 12, FontStyle.Bold)

Ken

------------------------

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
How can I change the font size of a text box dynamically?

I tried this but it didn't work. It said 'Size is Read-Only'. Any other ways around this? Here's the code:
txtDisplay.Font.Size = 10


Nov 20 '05 #3

P: n/a
Hello,

"VB Programmer" <gr*********@go-intech.com> schrieb:
How can I change the font size of a text box dynamically?

I tried this but it didn't work. It said 'Size is Read-Only'. Any other
ways around this? Here's the code:
txtDisplay.Font.Size = 10


Quick and Dirty:

\\\
Me.Font = _
New Font( _
Me.Font.FontFamily, _
200, _
Me.Font.Style, _
GraphicsUnit.Pixel _
)
///

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

P: n/a
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in
news:#1**************@TK2MSFTNGP09.phx.gbl:

200, _


You really like BIG fonts don't you? :)

Chris
Nov 20 '05 #5

P: n/a
"Chris Dunaway" <du******@lunchmeatsbcglobal.net> schrieb:
200, _


You really like BIG fonts don't you? :)


I have a really large monitor.

;-)))

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.