home *** CD-ROM | disk | FTP | other *** search
/ Discovering Windows 98 / WinExpert9.iso / Tips / VBPROGS.ZIP / Tutorial2 / frmUnits.frm (.txt) next >
Visual Basic Form  |  1997-10-19  |  2KB  |  75 lines

  1. VERSION 5.00
  2. Begin VB.Form frmUnits 
  3.    Caption         =   "Units Conversion"
  4.    ClientHeight    =   855
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   3615
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   855
  10.    ScaleWidth      =   3615
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton cmdConvert 
  13.       Caption         =   "Convert"
  14.       Enabled         =   0   'False
  15.       Height          =   375
  16.       Left            =   2400
  17.       TabIndex        =   4
  18.       Top             =   240
  19.       Width           =   975
  20.    End
  21.    Begin VB.TextBox txtCM 
  22.       Enabled         =   0   'False
  23.       Height          =   285
  24.       Left            =   1080
  25.       TabIndex        =   1
  26.       Top             =   480
  27.       Width           =   855
  28.    End
  29.    Begin VB.TextBox txtInches 
  30.       Height          =   285
  31.       Left            =   1080
  32.       TabIndex        =   0
  33.       Top             =   120
  34.       Width           =   855
  35.    End
  36.    Begin VB.Label Label2 
  37.       Caption         =   "Centimetres"
  38.       Height          =   255
  39.       Left            =   120
  40.       TabIndex        =   3
  41.       Top             =   480
  42.       Width           =   975
  43.    End
  44.    Begin VB.Label Label1 
  45.       Caption         =   "Inches"
  46.       Height          =   255
  47.       Left            =   120
  48.       TabIndex        =   2
  49.       Top             =   120
  50.       Width           =   735
  51.    End
  52. Attribute VB_Name = "frmUnits"
  53. Attribute VB_GlobalNameSpace = False
  54. Attribute VB_Creatable = False
  55. Attribute VB_PredeclaredId = True
  56. Attribute VB_Exposed = False
  57. Private Sub cmdConvert_Click()
  58.     txtCM.Text = txtInches.Text * 2.52
  59. End Sub
  60. Private Sub txtInches_Change()
  61.     If txtInches.Text = "" Then
  62.        cmdConvert.Enabled = False
  63.     Else
  64.        cmdConvert.Enabled = True
  65.     End If
  66. End Sub
  67. Private Sub txtInches_KeyPress(KeyAscii As Integer)
  68.     If Not IsNumeric(Chr(KeyAscii)) Then
  69.         If KeyAscii <> 8 Then
  70.             KeyAscii = 0
  71.             Beep
  72.         End If
  73.     End If
  74. End Sub
  75.