473,379 Members | 1,302 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,379 software developers and data experts.

Determine the font style of a label control

9
Hello All,

Does anyone know how to capture and save the font style of a label control.
(FontStyle.Bold, FontStyle.Italic, FontStyle.Underline)

I need to be able to save the font style and have it reapplied when I reopon my form.

I know how to "reapply" it when I open the form again. I just need help getting the original value for saving purposes.

Thanx in advance for any help.
Jun 17 '10 #1

✓ answered by ThatThatGuy

@sly9er
Capture and store the font of the Label using Label.Font...

Then you can determine the styles of the font such as using FontObject.FontFamily

To get the style you can check for underline FontObject.Underline

something like that

6 2347
sly9er
9
No takers?
Jun 17 '10 #2
ThatThatGuy
449 Expert 256MB
@sly9er
Capture and store the font of the Label using Label.Font...

Then you can determine the styles of the font such as using FontObject.FontFamily

To get the style you can check for underline FontObject.Underline

something like that
Jun 18 '10 #3
sly9er
9
ThatThatGuy,

YOU ARE THE MAN!!!

I have been searching on this topic for 3 days.

Thank you so much!

So if anyone else is having this issue, here is the fix.

Get the style propertie after after the font dialog button click. (OK or Cancel).

If FontDialog1.Font.Underline = True Then
MsgBox("underline")// replace this with your own process
End If

This was so elusive, but now I can us it for Bold, Underline, Italic, Strikout, and all the possible combinations.

Sweet. Now I can complete my script.

Whoo Hoo!
Jun 18 '10 #4
ThatThatGuy
449 Expert 256MB
@sly9er
You got the answer and you posted your answer as the best answer ... strange
Jun 19 '10 #5
sly9er
9
Oops,

Sorry about that. Not sure how I made that mistake.

Is there a way I can switch it to your answer?
Jun 19 '10 #6
ThatThatGuy
449 Expert 256MB
@sly9er
ya you've done that
Jun 19 '10 #7

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

Similar topics

2
by: John Bowman | last post by:
Hello, I need to concatonate 2 strings and insert padding spaces in between them. The number of padding spaces needs to be calculated such that I can place the entire resultant string into a...
7
by: Mike Casey | last post by:
Hello all, I have ASP.NET label controls tied to a datasource (so text will vary in length depending on the record). In IE everything looks great--text is wrapped if needed. In Netscape and...
1
by: Mervin Williams | last post by:
I am having a problem setting the CSSClass property of a my Label control. I set CSSClass property, but its not taking the font style settings. Here is my style: ..TabText { font-weight:...
2
by: John Holmes | last post by:
I would like to turn on a label control in javascript with the onfocus event of another control by setting the Visible property to true. When I try and reference this label control it says...
6
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax. I don't really understand the event. Where it...
4
by: cashdeskmac | last post by:
I want to justify the text in a label control so that all of the text fills the label equally, but there don't seem to be any properties to set to allow this. Can anyone help?
3
by: david | last post by:
I never use CSS for asp.net. I would like to get help about how to write CSS for the font size of asp label control. I have a lot of labels in asp.net web form design page. It seems that there is...
8
by: david | last post by:
I have developed a web form by using visual Studio. My question is: (1) what is the problem? (2) what is right way to do it? In the form, there are labels with id: lblWear, lblColor, and...
1
by: | last post by:
I have a label control that I've embedded in a datalist template. I will be binding data to that label. I want to run a string formatting function on the database text before it is injected into...
5
by: BobLaughland | last post by:
Hi There, I am trying to get some fields to align on a web page, like this, To: From: Subject: Each of the fields above have a corresponding asp:Textbox control next to it that I cannot...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.