home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch01 / focus / focus.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-02-20  |  3.6 KB  |  126 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "SetFocus Method"
  4.    ClientHeight    =   2655
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4275
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2655
  10.    ScaleWidth      =   4275
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton SaveBttn 
  13.       Caption         =   "Save Record"
  14.       Height          =   360
  15.       Left            =   2445
  16.       TabIndex        =   10
  17.       Top             =   2130
  18.       Width           =   1590
  19.    End
  20.    Begin VB.TextBox Text5 
  21.       Height          =   285
  22.       Left            =   3000
  23.       TabIndex        =   9
  24.       Top             =   1560
  25.       Width           =   975
  26.    End
  27.    Begin VB.TextBox Text4 
  28.       Height          =   285
  29.       Left            =   960
  30.       TabIndex        =   7
  31.       Top             =   1560
  32.       Width           =   615
  33.    End
  34.    Begin VB.TextBox Text3 
  35.       Height          =   285
  36.       Left            =   960
  37.       TabIndex        =   5
  38.       Top             =   1080
  39.       Width           =   1935
  40.    End
  41.    Begin VB.TextBox Text2 
  42.       Height          =   285
  43.       Left            =   960
  44.       TabIndex        =   1
  45.       Top             =   585
  46.       Width           =   3015
  47.    End
  48.    Begin VB.TextBox Text1 
  49.       Height          =   285
  50.       Left            =   960
  51.       TabIndex        =   0
  52.       Top             =   120
  53.       Width           =   1935
  54.    End
  55.    Begin VB.Label Label5 
  56.       Caption         =   "ZIP Code"
  57.       Height          =   255
  58.       Left            =   1920
  59.       TabIndex        =   8
  60.       Top             =   1575
  61.       Width           =   855
  62.    End
  63.    Begin VB.Label Label4 
  64.       Caption         =   "State"
  65.       Height          =   255
  66.       Left            =   120
  67.       TabIndex        =   6
  68.       Top             =   1575
  69.       Width           =   735
  70.    End
  71.    Begin VB.Label Label3 
  72.       Caption         =   "City"
  73.       Height          =   255
  74.       Left            =   120
  75.       TabIndex        =   4
  76.       Top             =   1095
  77.       Width           =   615
  78.    End
  79.    Begin VB.Label Label2 
  80.       Caption         =   "Address"
  81.       Height          =   255
  82.       Left            =   120
  83.       TabIndex        =   3
  84.       Top             =   600
  85.       Width           =   975
  86.    End
  87.    Begin VB.Label Label1 
  88.       Caption         =   "Name"
  89.       Height          =   255
  90.       Left            =   120
  91.       TabIndex        =   2
  92.       Top             =   135
  93.       Width           =   1095
  94.    End
  95. Attribute VB_Name = "Form1"
  96. Attribute VB_GlobalNameSpace = False
  97. Attribute VB_Creatable = False
  98. Attribute VB_PredeclaredId = True
  99. Attribute VB_Exposed = False
  100. Private Sub Form_Load()
  101. End Sub
  102. Private Sub SaveBttn_Click()
  103.     MsgBox "Record Saved. Click OK to enter another"
  104.     Text1.Text = ""
  105.     Text2.Text = ""
  106.     Text3.Text = ""
  107.     Text4.Text = ""
  108.     Text5.Text = ""
  109.     Text1.SetFocus
  110. End Sub
  111. Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
  112.     If KeyCode = 13 Then Text2.SetFocus
  113. End Sub
  114. Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
  115.     If KeyCode = 13 Then Text3.SetFocus
  116. End Sub
  117. Private Sub Text3_KeyUp(KeyCode As Integer, Shift As Integer)
  118.     If KeyCode = 13 Then Text4.SetFocus
  119. End Sub
  120. Private Sub Text4_KeyUp(KeyCode As Integer, Shift As Integer)
  121.     If KeyCode = 13 Then Text5.SetFocus
  122. End Sub
  123. Private Sub Text5_KeyUp(KeyCode As Integer, Shift As Integer)
  124.     If KeyCode = 13 Then SaveBttn.SetFocus
  125. End Sub
  126.