home *** CD-ROM | disk | FTP | other *** search
- Type APIFontMasterForm From SampleMasterForm
- Dim btnSetFont As New Button
- Dim Label1 As New Label
- Dim lblTest As New Label
- Dim TestFont As New Font
- Dim FontPanel As New FontDialog
- Dim Label2 As New Label
- Dim lblFaceName As New Label
- Dim Label4 As New Label
- Dim lblColor As New Label
- Dim Label6 As New Label
- Dim lblSize As New Label
- Dim Label8 As New Label
- Dim lblBold As New Label
- Dim Label10 As New Label
- Dim Label11 As New Label
- Dim Label12 As New Label
- Dim lblItalic As New Label
- Dim lblUnderline As New Label
- Dim lblStrikethru As New Label
-
- ' METHODS for object: APIFontMasterForm
- Sub btnSetFont_Click()
- FontPanel.Title = "Choose font properties"
- ' Post the FontPanel
- FontPanel.Execute
-
- ' Set font attributes to test label
- TestFont.Bold = FontPanel.Bold
- TestFont.FaceName = FontPanel.FaceName
- TestFont.Italic = FontPanel.Italic
- TestFont.Size = FontPanel.Size
- TestFont.Strikethru = FontPanel.Strikethru
- TestFont.Underline = FontPanel.Underline
-
- ' Update the foreground color
- lblTest.ForeColor = FontPanel.Color
-
- ' Update the status properties
- lblFaceName.Caption = FontPanel.FaceName
- lblColor.Caption = FontPanel.Color
- lblSize.Caption = FontPanel.Size
- lblBold.Caption = FontPanel.Bold
- lblItalic.Caption = FontPanel.Italic
- lblUnderline.Caption = FontPanel.Underline
- lblStrikethru.Caption = FontPanel.Strikethru
-
- End Sub
-
- Sub ResetApplication_Click ()
-
- ' Initialize Font Dialog Demonstration
-
- ' Set font attributes to test label
- TestFont.Bold = "True"
- TestFont.FaceName = "System"
- TestFont.Italic = "False"
- TestFont.Size = 12
- TestFont.Strikethru = "False"
- TestFont.Underline = "False"
-
- ' Set the default foreground color
- lblTest.ForeColor = -1
-
- ' Update the status properties
- lblFaceName.Caption = TestFont.FaceName
- lblColor.Caption = lblTest.ForeColor
- lblSize.Caption = TestFont.Size
- lblBold.Caption = TestFont.Bold
- lblItalic.Caption = TestFont.Italic
- lblUnderline.Caption = TestFont.Underline
- lblStrikethru.Caption = TestFont.Strikethru
-
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: APIFontMasterForm
- '
- With APIFontMasterForm
- .Caption := "Windows Font Dialog Demonstration"
- .Move(5205, 1335, 6885, 5340)
- .SampleDir := "W:\Examples\apifont\"
- .SampleName := "apifont"
- With .btnSetFont
- .Caption := "SetFont"
- .Move(2700, 3900, 1650, 450)
- End With 'APIFontMasterForm.btnSetFont
- With .Label1
- .Caption := "1. Click SetFont button to select font properties."
- .ForeColor := 13107200
- .Move(300, 300, 5250, 300)
- End With 'APIFontMasterForm.Label1
- With .lblTest
- .Caption := "Font Test"
- .BackColor := 16777215
- .ForeColor := 8388608
- .Font := APIFontMasterForm.TestFont
- .Move(450, 750, 5850, 1350)
- .BorderStyle := "Fixed Single"
- .Alignment := "Center"
- End With 'APIFontMasterForm.lblTest
- With .TestFont
- .FaceName := "Matura MT Script Capitals"
- .Size := 15
- .Italic := True
- End With 'APIFontMasterForm.TestFont
- With .FontPanel
- .FaceName := "Matura MT Script Capitals"
- .Size := 16
- .Bold := True
- .Italic := True
- .Color := 8388608
- .Title := "Choose font properties"
- End With 'APIFontMasterForm.FontPanel
- With .Label2
- .Caption := "FaceName:"
- .ForeColor := 13107200
- .Move(450, 2400, 1350, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label2
- With .lblFaceName
- .Caption := "Matura MT Script Capitals"
- .Move(1950, 2400, 4350, 300)
- End With 'APIFontMasterForm.lblFaceName
- With .Label4
- .Caption := "Color:"
- .ForeColor := 13107200
- .Move(450, 2700, 1350, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label4
- With .lblColor
- .Caption := "8388608"
- .Move(1950, 2700, 2235, 300)
- End With 'APIFontMasterForm.lblColor
- With .Label6
- .Caption := "Size:"
- .ForeColor := 13107200
- .Move(450, 3000, 1350, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label6
- With .lblSize
- .Caption := "16"
- .Move(1950, 3000, 2235, 300)
- End With 'APIFontMasterForm.lblSize
- With .Label8
- .Caption := "Bold:"
- .ForeColor := 13107200
- .Move(450, 3300, 1350, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label8
- With .lblBold
- .Caption := "True"
- .Move(1950, 3300, 2235, 300)
- End With 'APIFontMasterForm.lblBold
- With .Label10
- .Caption := "Italic:"
- .ForeColor := 13107200
- .Move(4350, 2700, 1050, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label10
- With .Label11
- .Caption := "Underline:"
- .ForeColor := 13107200
- .Move(4350, 3000, 1050, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label11
- With .Label12
- .Caption := "Strikethru:"
- .ForeColor := 13107200
- .Move(4350, 3300, 1050, 300)
- .Alignment := "Right"
- End With 'APIFontMasterForm.Label12
- With .lblItalic
- .Caption := "True"
- .Move(5550, 2700, 750, 300)
- End With 'APIFontMasterForm.lblItalic
- With .lblUnderline
- .Caption := "False"
- .Move(5550, 3000, 750, 300)
- End With 'APIFontMasterForm.lblUnderline
- With .lblStrikethru
- .Caption := "False"
- .Move(5550, 3300, 750, 300)
- End With 'APIFontMasterForm.lblStrikethru
- With .helpfile
- .FileName := "W:\Examples\apifont\apifont.hlp"
- End With 'APIFontMasterForm.helpfile
- End With 'APIFontMasterForm
- End Code
-