home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Event sample #2"
- ClientHeight = 3720
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 5940
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4125
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 3720
- ScaleWidth = 5940
- Top = 1140
- Width = 6060
- Begin VB.TextBox Text4
- Appearance = 0 'Flat
- Height = 375
- Left = 300
- TabIndex = 4
- Top = 2340
- Width = 1815
- End
- Begin VB.TextBox Text3
- Appearance = 0 'Flat
- Height = 375
- Left = 300
- TabIndex = 2
- Top = 1800
- Width = 1815
- End
- Begin VB.TextBox Text2
- Appearance = 0 'Flat
- Height = 375
- Left = 300
- TabIndex = 1
- Text = "600"
- Top = 1200
- Width = 1815
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 435
- Left = 300
- TabIndex = 0
- Top = 540
- Width = 1815
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Enter #>500 and press tab."
- ForeColor = &H80000008&
- Height = 255
- Left = 2220
- TabIndex = 3
- Top = 600
- Width = 3015
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Load()
- End Sub
- ' An infinite loop can be created as each control
- ' fails its valid condition and attempts to set
- ' the focus back to itself.
- Private Sub Text1_LostFocus()
- If Val(Text1.Text) > 500 Then Text1.SetFocus
- End Sub
- Private Sub Text2_LostFocus()
- If Val(Text2.Text) > 500 Then Text2.SetFocus
- End Sub
- ' A stack space overflow can be created when
- ' a change in one control causes a change in
- ' a second control.
- Private Sub Text3_Change()
- text4.Text = Str$(Val(text4.Text) + 1)
- End Sub
- Private Sub Text4_Change()
- text3.Text = Str$(Val(text3.Text) + 1)
- End Sub
-