Hello Emmery
you can use fontConverter class for get 'string' from font and get font from 'string' like this :
[CODE]
Dim
If FontDialog1.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
MainText.Font = FontDialog1.Font
MainText.ForeColor = FontDialog1.Color
End If
' FontType = FontDialog1.Font.ToString
'FontColor = FontDialog1.Color.ToString
Dim FntConverter As New FontConverter
Dim FontString As String = FntConverter.ConvertToString(FontDialog1.Font)
[/CODE]
Last used font and color saved to file
[CODE]
FileOpen(1, Application.StartupPath & "\Settings.txt", OpenMode.Output)
WriteLine(1, "Font = " & FontString )
WriteLine(1, "FontColor = " & FontColor)
FileClose(1)
[/CODE]
Program retrieves last used setting when opening
[CODE]
If System.IO.File.Exists(Application.StartupPath & "\Settings.txt") = True Then
FileOpen(1, Application.StartupPath & "\Settings.txt", OpenMode.Input)
Do Until EOF(1)
Input(1, strinput)
If Trim(strinput).StartsWith("Font") Then
split = strinput.Split("=")
FontType= Trim(split(1))
Dim tempfont As Font=FntConverter.ConvertFromString(FontType)
MainText.Font = tempfont '***ERROR HERE
End If
Loop
FileClose(1)
End If
[/CODE]
thanks
Please mark as answer if it helps