473,657 Members | 2,371 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 1296
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
3170
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 newbie at xml and xsl This is my xml("index.xml")page(I can not change this, it comes to me this way. <?xml version="1.0" encoding="iso-8859-1" ?>
16
14524
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: ------------------------------------- body { font: 8pt "face" } #nav {float: left; width: 144px; } #test { font: 12pt; font-weight: bold } -------------------------------------
15
7176
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 http://www.northamptontoday.co.uk/ViewArticle.aspx?SectionID=317&ArticleID=867063 for example. A+ A- in top right). A div id is used to apply the function to text within that id. My problem: I am working with a large intranet, all of the page
2
57232
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 is Write-Protected. There is only a Get-Method and no Set. Plz Help
5
130273
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
41179
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
3028
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
3057
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 to change the font size. I tried using the cell's attribute to change the font size. I tried adding a paragraph element and doing the above to it. Removed all font sizes from Body, Table...
3
3841
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 user change font-size dynamically visited link's font-size will be change. i use dropdown list for font-size values . there are 24 links on the page.links id="a1" a2,a3, so on.. function denemelink(){ var...
0
17018
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 culture-oriented applications). So if a label string is "Increase" the same string in Bugarian language will be "Увеличаване на скоростта". So what we see from above example, that the text size changes with change in language. If I want to limit the...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
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 we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.