home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / enigma31 / samples.zi_ / samples.zi / Level3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-06  |  4.3 KB  |  176 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Level Three"
  4.    ClientHeight    =   2685
  5.    ClientLeft      =   3645
  6.    ClientTop       =   2730
  7.    ClientWidth     =   3645
  8.    Height          =   3090
  9.    Left            =   3585
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   2685
  13.    ScaleWidth      =   3645
  14.    Top             =   2385
  15.    Width           =   3765
  16.    Begin VB.TextBox txtKickOut 
  17.       Height          =   315
  18.       Left            =   120
  19.       TabIndex        =   5
  20.       Top             =   1770
  21.       Width           =   735
  22.    End
  23.    Begin VB.CommandButton Command3 
  24.       Caption         =   "E&xit"
  25.       Height          =   405
  26.       Left            =   2490
  27.       TabIndex        =   4
  28.       Top             =   2190
  29.       Width           =   1065
  30.    End
  31.    Begin VB.CommandButton Command2 
  32.       Caption         =   "&Continue"
  33.       Height          =   405
  34.       Left            =   1290
  35.       TabIndex        =   3
  36.       Top             =   2190
  37.       Width           =   1065
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       Caption         =   "&Register"
  41.       Enabled         =   0   'False
  42.       Height          =   405
  43.       Left            =   120
  44.       TabIndex        =   2
  45.       Top             =   2190
  46.       Width           =   1065
  47.    End
  48.    Begin VB.TextBox Text2 
  49.       Height          =   315
  50.       Left            =   930
  51.       MultiLine       =   -1  'True
  52.       TabIndex        =   1
  53.       Top             =   1770
  54.       Width           =   2565
  55.    End
  56.    Begin VB.TextBox Text1 
  57.       Height          =   1575
  58.       Left            =   120
  59.       MultiLine       =   -1  'True
  60.       TabIndex        =   0
  61.       Top             =   90
  62.       Width           =   3405
  63.    End
  64. Attribute VB_Name = "Form1"
  65. Attribute VB_Creatable = False
  66. Attribute VB_Exposed = False
  67. Option Explicit
  68. Private Sub Command1_Click()
  69. Dim stext1 As String
  70. Dim stext2 As Variant
  71. stext1 = Text1.Text
  72. stext2 = Text2.Text
  73.     If Jumbler(stext1, stext2) = False Then
  74.         MsgBox "Registration Information Is Invalid", 48, "Shareware"
  75.         Text1.Text = ""
  76.         Text2.Text = ""
  77.         txtKickOut = ""
  78.         Text1.SetFocus
  79.         
  80.     Else
  81.         MsgBox "Thank You, Registration Accepted", , "Shareware"
  82.         
  83.             WriteIt stext1, stext2
  84.             benable = True
  85.             Unload Me
  86.             
  87.             Form2.Show
  88.         
  89.     End If
  90. End Sub
  91. Private Sub Command2_Click()
  92.         
  93.         Unload Me
  94.         Form2.Caption = Form1.Caption
  95.         Form2.Show
  96.         
  97. End Sub
  98. Private Sub Command3_Click()
  99.         
  100.         End
  101.         
  102. End Sub
  103. Private Sub Form_Load()
  104.         
  105.         Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  106.        
  107.        
  108. End Sub
  109. Private Sub Text1_Change()
  110.         
  111.         EnableButtons
  112.         
  113. End Sub
  114. Private Sub Text2_Change()
  115.         
  116.         EnableButtons
  117.         
  118. End Sub
  119. Private Sub EnableButtons()
  120.     If Text1.Text > "" And Text2.Text > "" And txtKickOut.Text > "" Then
  121.         Command1.Enabled = True
  122.         
  123.     Else
  124.         Command1.Enabled = False
  125.         
  126.     End If
  127. End Sub
  128. Private Sub Text2_GotFocus()
  129.         
  130.         If txtKickOut.Text = "" Then
  131.         
  132.             txtKickOut.SetFocus
  133.             
  134.         End If
  135. End Sub
  136. Private Sub Text3_Change()
  137.         
  138.         
  139. End Sub
  140. Private Sub Text2_KeyPress(KeyAscii As Integer)
  141.         
  142.         If KeyAscii = 13 Then
  143.         
  144.             Command1_Click
  145.             
  146.         End If
  147. End Sub
  148. Private Sub txtKickOut_Change()
  149.         
  150.         Dim LenText As Integer
  151.         
  152.            LenText = Len(txtKickOut.Text)
  153.            
  154.            If LenText = 3 Then
  155.             
  156.                 If Kickout(txtKickOut.Text) = False Then
  157.                 
  158.                     txtKickOut.Text = ""
  159.                     txtKickOut.SetFocus
  160.                     
  161.                 Else
  162.                 
  163.                     Text2.SetFocus
  164.                     
  165.                 End If
  166.                 End If
  167.                 
  168.         EnableButtons
  169. End Sub
  170. Private Sub txtKickOut_GotFocus()
  171.         
  172.         If Text1.Text = "" Then
  173.             Text1.SetFocus
  174.         End If
  175. End Sub
  176.