473,320 Members | 2,180 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,320 software developers and data experts.

How to change font size dynamically?

I see this question has been brought up before but the thread was closed. I inherited a website where clients can submit transactions and on the same site we can approve them internally. To make the process easier I've been asked to highlight the Label fields where changes were made. I've also been asked to make the text Bold. The Labels are contained in a Form so the font is ReadOnly. The previous post said you could get around that by creating a new Font. I am still frustrated by Property 'Font' is 'ReadOnly'. Any advice would be appreciated.
Expand|Select|Wrap|Line Numbers
  1. Dim boldFont As New Font("Calibri", FontStyle.Bold)
  2. Dim lLabelFirstName As Label = _
  3. FormViewReviewEnrollment.FindControl("LabelFirstName")
  4. lLabelFirstName.BackColor = Color.Yellow
  5. lLabelFirstName.Font = boldFont
  6.  
Oct 21 '14 #1

✓ answered by iam_clint

Expand|Select|Wrap|Line Numbers
  1.         Dim lLabelFirstName As Label = DirectCast(FormView1.FindControl("ClubNameLbl"), Label)
  2.         lLabelFirstName.BackColor = Drawing.Color.Yellow
  3.         lLabelFirstName.Font.Bold = True
  4.  
I had absolutely no problems running this code from a button on an item in the formview.

4 1290
iam_clint
1,208 Expert 1GB
I believe you can set the individual properties. .font.bold=true. .font.size=13
Oct 22 '14 #2
Not when it is containted in a <asp:FormView>. I keep getting errors saying that Font is readonly if I try to add code to update it in the VB
Oct 22 '14 #3
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1.         Dim lLabelFirstName As Label = DirectCast(FormView1.FindControl("ClubNameLbl"), Label)
  2.         lLabelFirstName.BackColor = Drawing.Color.Yellow
  3.         lLabelFirstName.Font.Bold = True
  4.  
I had absolutely no problems running this code from a button on an item in the formview.
Oct 22 '14 #4
I don't know what I was doing wrong but I must not have been doing something correctly because it is working now. Thank you so much.
Oct 22 '14 #5

Sign in to post your reply or Sign up for a free account.

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...
5
by: VB Programmer | last post by:
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
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,
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: vijeta | last post by:
Well, I came across a problem in which based on system selected language, my label text will change. This is called Localization in C#/.Net (Localization is a technique to implement local and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.