473,503 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change font size dynamically?

3 New Member
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
4 1291
iam_clint
1,208 Recognized Expert Top Contributor
I believe you can set the individual properties. .font.bold=true. .font.size=13
Oct 22 '14 #2
NEPProgrammer
3 New Member
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 Recognized Expert Top Contributor
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
NEPProgrammer
3 New Member
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
3157
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
14500
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
7160
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
57214
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
130193
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
41162
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
3010
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
3047
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
3825
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
16975
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
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.