home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dump_s1r / fontwndo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-12-15  |  3.0 KB  |  95 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFontWindow 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Font Window Example"
  6.    ClientHeight    =   1980
  7.    ClientLeft      =   48
  8.    ClientTop       =   336
  9.    ClientWidth     =   2784
  10.    Icon            =   "FontWndo.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1980
  16.    ScaleWidth      =   2784
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   2  'CenterScreen
  19.    Begin VB.CommandButton cmdChangeFont 
  20.       Caption         =   "Change Font"
  21.       Height          =   435
  22.       Left            =   900
  23.       TabIndex        =   4
  24.       Top             =   30
  25.       Width           =   1035
  26.    End
  27.    Begin VB.CommandButton cmdRedraw 
  28.       Caption         =   "Redraw"
  29.       Height          =   285
  30.       Left            =   1710
  31.       TabIndex        =   2
  32.       Top             =   750
  33.       Width           =   1065
  34.    End
  35.    Begin VB.TextBox txtPrevText 
  36.       Appearance      =   0  'Flat
  37.       Height          =   285
  38.       Left            =   60
  39.       TabIndex        =   1
  40.       TabStop         =   0   'False
  41.       Text            =   "Preview Text"
  42.       Top             =   750
  43.       Width           =   1635
  44.    End
  45.    Begin VB.PictureBox pPrev 
  46.       Appearance      =   0  'Flat
  47.       AutoRedraw      =   -1  'True
  48.       BackColor       =   &H00000080&
  49.       ForeColor       =   &H80000008&
  50.       Height          =   885
  51.       Left            =   30
  52.       ScaleHeight     =   864
  53.       ScaleWidth      =   2724
  54.       TabIndex        =   0
  55.       TabStop         =   0   'False
  56.       Top             =   1050
  57.       Width           =   2745
  58.    End
  59.    Begin VB.Label lblTxt2Draw 
  60.       Caption         =   "Text To Print:"
  61.       Height          =   195
  62.       Left            =   120
  63.       TabIndex        =   3
  64.       Top             =   510
  65.       Width           =   960
  66.    End
  67. Attribute VB_Name = "frmFontWindow"
  68. Attribute VB_GlobalNameSpace = False
  69. Attribute VB_Creatable = False
  70. Attribute VB_PredeclaredId = True
  71. Attribute VB_Exposed = False
  72. Option Explicit
  73. Private Sub cmdChangeFont_Click()
  74. Set pPrev.Font = ShowFontWindow(pPrev.Font, pPrev.ForeColor, pPrev.ForeColor)
  75. RedrawPrev
  76. End Sub
  77. Private Sub RedrawPrev()
  78. pPrev.Cls
  79. pPrev.ForeColor = vbGrayText
  80. pPrev.CurrentX = pPrev.Width / 2 - pPrev.TextWidth(txtPrevText) / 2 + 45
  81. pPrev.CurrentY = pPrev.Height / 2 - pPrev.TextHeight(txtPrevText) / 2 + 45
  82. pPrev.Print txtPrevText
  83. pPrev.ForeColor = vbWhite
  84. pPrev.CurrentX = pPrev.Width / 2 - pPrev.TextWidth(txtPrevText) / 2
  85. pPrev.CurrentY = pPrev.Height / 2 - pPrev.TextHeight(txtPrevText) / 2
  86. pPrev.Print txtPrevText
  87. End Sub
  88. Private Sub cmdRedraw_Click()
  89. RedrawPrev
  90. End Sub
  91. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  92. If UnloadMode = 1 Then Exit Sub
  93. Cancel = True
  94. End Sub
  95.