home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / enigma31 / samples.zi_ / samples.zi / Level1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-09-02  |  3.9 KB  |  162 lines

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