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

saving and restoring fonts

Sorry another dumb question about vb.net

How do I save a font (in a text file) so that I can restore it at later
date.

I thought

MyString=txtBox.font.tostring

Write that away.

Read it later

But how do I set it

txtbox.font=mystring does not work

Thanks
Jul 21 '05 #1
2 1342
Hello,
If you only need to save Font's name then you can do like this:
string fontname = textBox1.Font.Name;

and later assign it as textBox1.Font = new Font(fontname,8.25f);

but if you want to save other attributes related to the font then I
think you must use Xml File and save these attributes with their names
and later use appropriate Font constructor to make a font for the
textBox.

HTH. Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Jul 21 '05 #2
Maqsood Ahmed wrote:
Hello,
If you only need to save Font's name then you can do like this:
string fontname = textBox1.Font.Name;

and later assign it as textBox1.Font = new Font(fontname,8.25f);

but if you want to save other attributes related to the font then I
think you must use Xml File and save these attributes with their names
and later use appropriate Font constructor to make a font for the
textBox.

HTH. Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***

Thanks, stupidly I tried it without the size (since I knew there was a
size property but did not realise that it was read only!
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jacob H | last post by:
Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm using the pickle...
5
by: Michael Albanese | last post by:
Can you save objects a (custom class) to Viewstate and then get them on a later page?? I have a custom class for an ASP.Net application that I would like to make available across several web...
3
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
1
by: Tom | last post by:
I have a large application; lots of forms, multiple dynamic DLLs, etc. I also have, in the appliation, a general 'Preferences' class object (which is in itself a separate DLL, and I just include a...
15
by: Marcus Kwok | last post by:
How do you save the formatting options for a stream? In the program below, notice that when I define my operator<<() for the custom type, it permanently changes the output format of the stream: ...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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...
1
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.