LoadFonts




Private Sub LoadScreenFonts(List As ListBox)
For i = 0 To Screen.FontCount - 1
'loads fonts from screen

List.AddItem Screen.Fonts(i)
Next i
End Sub

Public Sub LoadRegFonts(List As ListBox)
For i = 0 To Val(RegCount) - 1
'Loads fonts from registry using GETSETTING

List1.AddItem GetSetting("Font Load", "Fonts", i)
Next
End Sub

Public Sub SaveFonts()
Dim Count As Integer
For i = 0 To Screen.FontCount - 1
Count = Count + 1
SaveSetting "Font Load", "Fonts", i, Screen.Fonts(i)
'Loops through all the fonts and saves them To

'registry using SAVESETTING

Next
SaveSetting "Font Load", "Fonts", "Count", Count
End Sub

Private Sub Form_Load()
RegCount = GetSetting("Font Load", "Fonts", "Count")
If GetSetting("Font Load", "Fonts", "Count") <> "" Then
'Checks To see if fonts were saved already...

LoadRegFonts List1 'If so, load from registry
Else
LoadScreenFonts List1 'If not, load from screen
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
If RegCount <> "" Then
End
Else
SaveFonts
'Decides wether it needs To save fonts again or Not

End If
End Sub










( loadfonts.html )- by Paolo Puglisi - Modifica del 17/12/2023