ERFORDERLICHE
OBJEKTE
2 Commandbuttons (Command1, Command2)
1 Label (Label1)
FORM-CODE
Private Declare Function AddFontResource Lib "gdi32" Alias _
"AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" _
Alias "RemoveFontResourceA" (ByVal lpFileName _
As String) As Long
Dim FontDateiName
Private Sub Form_Load()
FontDateiName = App.Path
If Right(FontDateiName, 1) <> "\" Then _
FontDateiName = FontDateiName & "\" FontDateiName =_
FontDateiName & "quake.ttf"
End Sub
'Schriftart laden
Private Sub Command1_Click()
Dim ret As Long ret = AddFontResource(FontDateiName)
'if ret=0 Then ... (Fehler)
Label1.Font = "quake"
End Sub
'Schriftart entladen
Private Sub Command2_Click()
Dim ret As Long ret = RemoveFontResource(FontDateiName)
'if ret=0 Then ... (Fehler)
Label1.Font = "Arial"
End Sub
siehe auch
Prüfen, ob eine Schriftart installiert ist
|