home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / Src / Ch12 / dlgScale.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-06-18  |  2.6 KB  |  92 lines

  1. VERSION 5.00
  2. Begin VB.Form dlgScale 
  3.    Caption         =   "Scale"
  4.    ClientHeight    =   1485
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   3375
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   1485
  10.    ScaleWidth      =   3375
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton cmdOk 
  13.       Caption         =   "Ok"
  14.       Default         =   -1  'True
  15.       Height          =   375
  16.       Left            =   2400
  17.       TabIndex        =   5
  18.       Top             =   240
  19.       Width           =   735
  20.    End
  21.    Begin VB.CommandButton cmdCancel 
  22.       Cancel          =   -1  'True
  23.       Caption         =   "Cancel"
  24.       Height          =   375
  25.       Left            =   2400
  26.       TabIndex        =   4
  27.       Top             =   840
  28.       Width           =   735
  29.    End
  30.    Begin VB.TextBox txtScaleY 
  31.       Height          =   285
  32.       Left            =   1080
  33.       TabIndex        =   3
  34.       Text            =   "100.0"
  35.       Top             =   600
  36.       Width           =   615
  37.    End
  38.    Begin VB.TextBox txtScaleX 
  39.       Height          =   285
  40.       Left            =   1080
  41.       TabIndex        =   1
  42.       Text            =   "100.0"
  43.       Top             =   240
  44.       Width           =   615
  45.    End
  46.    Begin VB.Label Label1 
  47.       Caption         =   "Vertical"
  48.       Height          =   255
  49.       Index           =   1
  50.       Left            =   240
  51.       TabIndex        =   2
  52.       Top             =   600
  53.       Width           =   855
  54.    End
  55.    Begin VB.Label Label1 
  56.       Caption         =   "Horizontal"
  57.       Height          =   255
  58.       Index           =   0
  59.       Left            =   240
  60.       TabIndex        =   0
  61.       Top             =   240
  62.       Width           =   855
  63.    End
  64. Attribute VB_Name = "dlgScale"
  65. Attribute VB_GlobalNameSpace = False
  66. Attribute VB_Creatable = False
  67. Attribute VB_PredeclaredId = True
  68. Attribute VB_Exposed = False
  69. Option Explicit
  70. Private Canceled As Boolean
  71. ' Display the form. Return True if the user cancels.
  72. Public Function ShowForm(ByRef x_scale As Single, ByRef y_scale As Single) As Boolean
  73.     ' Assume we will cancel.
  74.     Canceled = True
  75.     ' Display the form.
  76.     Show vbModal
  77.     ShowForm = Canceled
  78.     If Not Canceled Then
  79.         On Error Resume Next
  80.         x_scale = CSng(txtScaleX.Text) / 100#
  81.         y_scale = CSng(txtScaleY.Text) / 100#
  82.         On Error GoTo 0
  83.     End If
  84. End Function
  85. Private Sub cmdCancel_Click()
  86.     Hide
  87. End Sub
  88. Private Sub cmdOk_Click()
  89.     Canceled = False
  90.     Hide
  91. End Sub
  92.