AVAX-software.com Forums: Problem using SetFonts - AVAX-software.com Forums

Jump to content

Page 1 of 1

Problem using SetFonts

#1 User is offline   Hjeldin_ita Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 03-March 09

Posted 03 March 2009 - 06:02 PM

Hi,
i'm having some trouble in using SetFonts.
I use the same example that can be found in help, and if i run it, it will result False.
The code is this:
Option Explicit

Private Sub Form_Load()
    Command1.Caption = "SetFonts"
    cAvax1.StartAvax
End Sub

Private Sub Form_Unload(Cancel As Integer)
    cAvax1.EndAvax
End Sub

Private Sub Command1_Click()
    Dim sFonts() As String
    Dim lFontsSet() As Long
    Dim Answer As Boolean
    Dim iCnt As Integer, lMax As Integer
    lMax = Screen.FontCount
    If lMax > 256 Then lMax = 256
    ReDim sFonts(lMax) As String, lFontsSet(lMax) As Long

    For iCnt = 0 To lMax - 1
        sFonts(iCnt + 1) = Screen.Fonts(iCnt)
        lFontsSet(iCnt + 1) = 0
    Next iCnt
    MsgBox cAvax1.SetFonts(sFonts(), lFontsSet()), vbInformation, "SetFonts"
End Sub


#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 11 March 2009 - 02:36 PM

The maximum number of fonts you can set is 246.
So, you have to change the code like this:
If lMax > 247 Then lMax = 247

Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users