Set font to an object from a line in a textfile
Posted on 2004-09-26
Hi experts, you'll probably laugh at my newbie question.
I wanna read a textfile and choose the font type written within it an apply it on a textbox. If I have a font dialog and apply the settings for fontDialog.Font sets correctly to textbox.Font. I also save fontDialog.Font to a textfile, and it looks something like this:
Dim row As New System.IO.StreamWriter("file")
textbox.Font = teckensnittDialog.Font
When I start my program I want it to read the line and apply the font on the textbox. I tried alot and now I've got this code:
Dim row As New System.IO.StreamReader("file")
textBox.Font = New System.Drawing.Font.FromLogFont(row.ReadLine())
So my questions is, do I need to convert the line which looks like this => [Font: Name=Footlight MT Light, Size=15,75, Units=3, GdiCharSet=0, GdiVerticalFont=False] before I apply it on textBox.Font?
I searched this site, MSDN and also spent a lot of time on google:ing this subject, but I haven't found any solutions. You're my last chance :-)