![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
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!
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
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)) |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
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?
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
I figured it out!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|