home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / protview / demowinx / data.1 / FONTSFRM.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-29  |  4.6 KB  |  153 lines

  1. VERSION 4.00
  2. Begin VB.Form FontsFrm 
  3.    Caption         =   "Font Selection Made Easy"
  4.    ClientHeight    =   5700
  5.    ClientLeft      =   2070
  6.    ClientTop       =   1395
  7.    ClientWidth     =   5235
  8.    Height          =   6105
  9.    Left            =   2010
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5700
  12.    ScaleWidth      =   5235
  13.    Top             =   1050
  14.    Width           =   5355
  15.    Begin VB.PictureBox ItalicOn 
  16.       Height          =   375
  17.       Left            =   5280
  18.       Picture         =   "FontsFrm.frx":0000
  19.       ScaleHeight     =   315
  20.       ScaleWidth      =   315
  21.       TabIndex        =   6
  22.       Top             =   2520
  23.       Visible         =   0   'False
  24.       Width           =   375
  25.    End
  26.    Begin VB.PictureBox ItalicOff 
  27.       Height          =   375
  28.       Left            =   5280
  29.       Picture         =   "FontsFrm.frx":018A
  30.       ScaleHeight     =   315
  31.       ScaleWidth      =   315
  32.       TabIndex        =   5
  33.       Top             =   1920
  34.       Visible         =   0   'False
  35.       Width           =   375
  36.    End
  37.    Begin VB.PictureBox BoldOn 
  38.       Height          =   375
  39.       Left            =   5280
  40.       Picture         =   "FontsFrm.frx":0314
  41.       ScaleHeight     =   315
  42.       ScaleWidth      =   315
  43.       TabIndex        =   3
  44.       Top             =   1320
  45.       Visible         =   0   'False
  46.       Width           =   375
  47.    End
  48.    Begin VB.PictureBox BoldOff 
  49.       Height          =   375
  50.       Left            =   5280
  51.       Picture         =   "FontsFrm.frx":049E
  52.       ScaleHeight     =   315
  53.       ScaleWidth      =   315
  54.       TabIndex        =   2
  55.       Top             =   720
  56.       Visible         =   0   'False
  57.       Width           =   375
  58.    End
  59.    Begin PVButtonLib.PVButton ItalicToggle 
  60.       Height          =   375
  61.       Left            =   4680
  62.       TabIndex        =   7
  63.       Top             =   120
  64.       Width           =   495
  65.       _Version        =   65541
  66.       _ExtentX        =   873
  67.       _ExtentY        =   661
  68.       _StockProps     =   70
  69.       Caption         =   ""
  70.    End
  71.    Begin PVButtonLib.PVButton BoldToggle 
  72.       Height          =   375
  73.       Left            =   4080
  74.       TabIndex        =   4
  75.       Top             =   120
  76.       Width           =   495
  77.       _Version        =   65541
  78.       _ExtentX        =   873
  79.       _ExtentY        =   661
  80.       _StockProps     =   70
  81.       Caption         =   ""
  82.    End
  83.    Begin VB.Label Label1 
  84.       Caption         =   $"FontsFrm.frx":0628
  85.       Height          =   4695
  86.       Left            =   120
  87.       TabIndex        =   1
  88.       Top             =   840
  89.       Width           =   4935
  90.    End
  91.    Begin PVFontSelLib.PVFontSel FontSel1 
  92.       Height          =   495
  93.       Left            =   120
  94.       TabIndex        =   0
  95.       Top             =   120
  96.       Width           =   3855
  97.       _Version        =   65536
  98.       _ExtentX        =   6800
  99.       _ExtentY        =   873
  100.       _StockProps     =   228
  101.    End
  102. Attribute VB_Name = "FontsFrm"
  103. Attribute VB_Creatable = False
  104. Attribute VB_Exposed = False
  105. Dim varBoldOn As Boolean
  106. Dim varItalicOn As Boolean
  107. Private Sub BoldToggle_Click()
  108. Rem toggle state of varBoldOn,
  109. Rem update the picture displayed,
  110. Rem repaint the font used by the label
  111. If (varBoldOn = True) Then
  112.    varBoldOn = False
  113.    BoldToggle.CustomPicture = boldoff.Picture
  114.    varBoldOn = True
  115.    BoldToggle.CustomPicture = BoldOn.Picture
  116. End If
  117. Label1.Font.Bold = varBoldOn
  118. End Sub
  119. Private Sub Command1_Click()
  120. End Sub
  121. Private Sub FontSel1_FontNameChange()
  122. Label1.Font.Name = FontSel1.GetFontName
  123. End Sub
  124. Private Sub FontSel1_PointSizeChange()
  125. Label1.Font.Size = FontSel1.GetPointSize
  126. End Sub
  127. Private Sub Form_Load()
  128. varBoldOn = Label1.Font.Bold
  129. If (varBoldOn = True) Then
  130.    BoldToggle.CustomPicture = BoldOn.Picture
  131.    BoldToggle.CustomPicture = boldoff.Picture
  132. End If
  133. varItalicOn = Label1.Font.Italic
  134. If (varItalicOn = True) Then
  135.    ItalicToggle.CustomPicture = ItalicOn.Picture
  136.    ItalicToggle.CustomPicture = italicoff.Picture
  137. End If
  138. FontSel1.SetFontName (Label1.Font.Name)
  139. FontSel1.SetPointSize (Label1.Font.Size)
  140. End Sub
  141. Private Sub ItalicToggle_Click()
  142. Rem toggle state of varItalicOn,
  143. Rem update the picture displayed,
  144. Rem repaint the font used by the label
  145. If (varItalicOn = True) Then
  146.    varItalicOn = False
  147.    ItalicToggle.CustomPicture = italicoff.Picture
  148.    varItalicOn = True
  149.    ItalicToggle.CustomPicture = ItalicOn.Picture
  150. End If
  151. Label1.Font.Italic = varItalicOn
  152. End Sub
  153.