هذا كود كتابة نص مائل في الفيجول يسك 6 :
Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal H As Long, ByVal W As Long, ByVal E As Long, ByVal O As Long, ByVal W As Long, ByVal I As Long, ByVal U As Long, ByVal S As Long, ByVal C As Long, ByVal OP As Long, ByVal CP As Long, ByVal Q As Long, ByVal PAF As Long, ByVal F As String) As Long Private Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hobject As Integer) As Integer Private Declare Function DeleteObject Lib "GDI" (ByVal hobject As Long) As Integer Private Sub Form_Load() Call drawText End Sub Sub drawText() Const txt = "This is written as a -45 degree angle." Dim newfont As Long Dim oldfont As Long Me.Cls 'create the logical font newfont = CreateFont(20, 0, -450, 0, FW_NORMAL, False, False, False, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_CHARSET_PRECIS, PROOF_QUALITY, VARIABLE_PITCH Or FF_ROMAN Or 4, "TimesNewRoman") 'select the new font oldfont = SelectObject(hdc, newfont) 'display the text Me.CurrentX = x Me.CurrentY = y Print Text 'newfont = SelectObject(hdc, oldfont) If DeleteObject(newfont) = 0 Then Beep MsgBox "Error deleting font object", vbExclamation End If End Sub
ولكن عند عمل run ظهر لي خطأ ولم أتمكن من معرفة سبب الخطأ
الرجاء المساعدة لمعرفة سبب الخطأ :

