473,322 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to change font size dynamically?

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
5 130122
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
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
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
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kmunderwood | last post by:
I am having trouble changing the font size when extracting xml into an html web page. I think it can be done so many ways, that my searches bring up examples that I am not familiar with. I am a...
16
by: Coder Droid | last post by:
I'm trying my first table-less site, and I've bumped my head up against a wall. I can't change the font size within a div. Real quick, my style sheet has: -------------------------------------...
15
by: lharby | last post by:
Basic question, is this possible? I have managed to crib a javascript function that allows the user to increase or decrease the font size of a page. (see...
2
by: Bjoern | last post by:
Hi all, how can i change the Font Size of the Text in my Label. I will change it dynamic in the code. I tryed: int number = 11; label1.Font.Size = number; But this is not possible because Size...
2
by: Dave | last post by:
How can I change the font size of a label? I have: Label1.Font.Size = "12" but it's telling me that property 'Size' is readonly. Thanks,
1
by: ken | last post by:
Hi, How do you change the font for the data labels on your bar graph report/chart? I have 24 series, and when I change the font of the data label for one series that does not change them all......
3
by: # Cyrille37 # | last post by:
Hello, Font.Size Property is readonly. How can I change the Size of a Font ??? Thanks for your help cyrille
5
by: _Who | last post by:
I spent all day yesterday trying different things. Something has happened so I can't change font size. I have a table and in the first cell I have only text. I tried using the cell's Style...
3
by: reyo | last post by:
Hi, i design a dynamic web page.infact it will be a css generator. i have a question about visited link. i want to change color,font-size,font-weight etc. of a link when it is visited. when a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.