home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / PWA_AWAR.ZIP / SAMPVB.Z / PASSWRD.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-07-05  |  4.6 KB  |  144 lines

  1. VERSION 2.00
  2. Begin Form passwrd 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Password Validation"
  6.    ClientHeight    =   2055
  7.    ClientLeft      =   1710
  8.    ClientTop       =   1590
  9.    ClientWidth     =   4830
  10.    ControlBox      =   0   'False
  11.    Height          =   2460
  12.    Left            =   1650
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2055
  17.    ScaleWidth      =   4830
  18.    Top             =   1245
  19.    Width           =   4950
  20.    Begin AwareBinary fpBinary1 
  21.       BackColor       =   &H00C0C0C0&
  22.       BorderStyle     =   0  'No Border
  23.       FontBold        =   -1  'True
  24.       FontItalic      =   0   'False
  25.       FontName        =   "System"
  26.       FontSize        =   9.75
  27.       FontStrikethru  =   0   'False
  28.       FontUnderline   =   0   'False
  29.       Height          =   2040
  30.       Left            =   0
  31.       TabIndex        =   0
  32.       ThreeDFrameWidth=   5
  33.       ThreeDInsideHighlightColor=   &H00FFFFFF&
  34.       ThreeDInsideShadowColor=   &H00808080&
  35.       ThreeDInsideStyle=   2  'Raised
  36.       ThreeDInsideWidth=   2
  37.       ThreeDOutsideHighlightColor=   &H00FFFFFF&
  38.       ThreeDOutsideShadowColor=   &H00808080&
  39.       ThreeDOutsideStyle=   2  'Raised
  40.       Top             =   0
  41.       Width           =   4815
  42.       Begin AwareText fpText1 
  43.          AlignTextH      =   1  'Center
  44.          AlignTextV      =   1  'Center
  45.          BackColor       =   &H00C0C0C0&
  46.          BorderStyle     =   0  'No Border
  47.          ControlType     =   2  'Static
  48.          FontBold        =   -1  'True
  49.          FontItalic      =   0   'False
  50.          FontName        =   "MS Sans Serif"
  51.          FontSize        =   9.75
  52.          FontStrikethru  =   0   'False
  53.          FontUnderline   =   0   'False
  54.          ForeColor       =   &H000000FF&
  55.          Height          =   465
  56.          Left            =   75
  57.          TabIndex        =   4
  58.          TabStop         =   0   'False
  59.          Text            =   "Please enter your password below..."
  60.          ThreeDOutsideStyle=   1  'Lowered
  61.          ThreeDText      =   2  'Embossed w/ shading
  62.          ThreeDTextHighlightColor=   &H00FFFFFF&
  63.          ThreeDTextShadowColor=   &H00000010&
  64.          Top             =   75
  65.          Width           =   4440
  66.       End
  67.       Begin AwareText fpText2 
  68.          AlignTextH      =   1  'Center
  69.          AlignTextV      =   1  'Center
  70.          AutoCase        =   2  'Lower
  71.          FontBold        =   -1  'True
  72.          FontItalic      =   0   'False
  73.          FontName        =   "MS Sans Serif"
  74.          FontSize        =   9.75
  75.          FontStrikethru  =   0   'False
  76.          FontUnderline   =   0   'False
  77.          Height          =   390
  78.          Left            =   750
  79.          PasswordChar    =   "*"
  80.          TabIndex        =   1
  81.          ThreeDOutsideStyle=   2  'Raised
  82.          ThreeDTextHighlightColor=   &H00000014&
  83.          ThreeDTextShadowColor=   &H00000010&
  84.          Top             =   750
  85.          Width           =   2940
  86.       End
  87.       Begin CommandButton Command1 
  88.          Caption         =   "OK"
  89.          Height          =   400
  90.          Left            =   600
  91.          TabIndex        =   3
  92.          Top             =   1275
  93.          Width           =   1440
  94.       End
  95.       Begin CommandButton Command2 
  96.          Caption         =   "Cancel"
  97.          Height          =   400
  98.          Left            =   2325
  99.          TabIndex        =   2
  100.          Top             =   1275
  101.          Width           =   1440
  102.       End
  103.    End
  104. Sub Command1_Click ()
  105.     If Not Valid_Password(selectedpassword) Then
  106.         MsgBox "This is not the correct password.  Please re-enter..."
  107.         fptext2.Text = ""
  108.         fptext2.SetFocus
  109.     Else
  110.         was_valid = True
  111.         Me.Hide
  112.     End If
  113. End Sub
  114. Sub Command2_Click ()
  115.     selectedname = "default"
  116.     Me.Hide
  117. End Sub
  118. Sub Form_Activate ()
  119.     fptext2.Text = ""
  120.     fptext2.SetFocus
  121. End Sub
  122. Sub Form_Load ()
  123.     centerform Me
  124. End Sub
  125. Sub fpText2_KeyPress (keyascii As Integer)
  126.     If keyascii = 13 Then
  127.         If Not Valid_Password(selectedpassword) Then
  128.             MsgBox "This is not the correct password.  Please re-enter..."
  129.             fptext2.Text = ""
  130.             fptext2.SetFocus
  131.         Else
  132.             was_valid = True
  133.             Me.Hide
  134.         End If
  135.     End If
  136. End Sub
  137. Function Valid_Password (word As String) As Integer
  138.     If fptext2.Text = word Then
  139.         Valid_Password = True
  140.     Else
  141.         Valid_Password = False
  142.     End If
  143. End Function
  144.