home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form enmfntx
- Caption = "Enum Font Example"
- ClientHeight = 3690
- ClientLeft = 1095
- ClientTop = 1500
- ClientWidth = 7215
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3690
- ScaleWidth = 7215
- Begin VB.ListBox List2
- Height = 1395
- Left = 60
- TabIndex = 4
- Top = 600
- Width = 6975
- End
- Begin VB.CommandButton cmdListTrueType
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "List All TrueType"
- Height = 435
- Left = 1560
- TabIndex = 3
- Top = 120
- Width = 1755
- End
- Begin VB.CommandButton CmdListVariations
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "List Variations"
- Height = 435
- Left = 5280
- TabIndex = 2
- Top = 120
- Width = 1755
- End
- Begin VB.CommandButton CmdListFonts
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "List All Fonts"
- Height = 435
- Left = 3420
- TabIndex = 1
- Top = 120
- Width = 1755
- End
- Begin VB.ListBox List1
- Height = 1200
- Left = 60
- TabIndex = 0
- Top = 2280
- Width = 6975
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "Font variations with a family:"
- Height = 255
- Left = 60
- TabIndex = 6
- Top = 2040
- Width = 2595
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Font families:"
- Height = 255
- Left = 60
- TabIndex = 5
- Top = 300
- Width = 1395
- End
- Attribute VB_Name = "enmfntx"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Copyright
- 1997 by Desaware Inc. All Rights Reserved.
- Private Sub CmdListVariations_Click()
- Dim di&
- Dim fname$
- Dim f%
- List1.Clear
- fname$ = List2.Text
- f% = InStr(fname$, " -- ")
- If f% > 0 Then
- fname$ = Left$(fname$, f% - 1)
- End If
- ' This gets Arial only (all styles)
- di = EnumFontFamilies(hdc, fname$, AddressOf Callback1_EnumFonts, 2)
- End Sub
- Private Sub CmdListFonts_Click()
- Dim di&
- List1.Clear
- List2.Clear
- ' This gets one font for each family
- di = EnumFontFamilies(hdc, vbNullString, AddressOf Callback1_EnumFonts, 0)
- End Sub
- Private Sub cmdListTrueType_Click()
- Dim di&
- List1.Clear
- List2.Clear
- ' This gets one font for each family
- ' Danger - be sure to use vbNullString, not 0! Nasty VB type conversion!
- di = EnumFontFamilies(hdc, vbNullString, AddressOf Callback1_EnumFonts, 1)
- End Sub
- Private Sub Form_Load()
- End Sub
- Private Sub List2_Click()
- CmdListVariations_Click
- End Sub
-