Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 21st, 2005, 10:09 AM   #1
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
String to Font

I opened a Font Dialog then had the user select a font which is then converted to a string and written to a .ini for later use. I open the file and read the ine with the font on it and now I want to convert the string back to a font, can this be done in code? Please help me, thanx!
squishiful is offline   Reply With Quote
Old Jun 21st, 2005, 10:48 AM   #2
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
I figured it out, heres what I have to do.
read = System.IO.File.OpenText("prefs.ini")
Dim i As Integer
While (read.Peek <> -1)
     prefs(i) = read.ReadLine()
End While
Dim tc As System.ComponentModel.TypeConverter
tc = System.ComponentModel.TypeDescriptor.GetConverter(Font)
textBox.Font() = tc.ConvertFromString(prefs(0))
it worx!
squishiful is offline   Reply With Quote
Old Jun 21st, 2005, 11:57 AM   #3
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
okay that doesn;t work never mind that will only work with the font but there are more things in that .ini so does anyone know of a way that will work?
squishiful is offline   Reply With Quote
Old Jun 21st, 2005, 9:26 PM   #4
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
I figured it out!
squishiful is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC