home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / intern1a / frmlogin.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-10-01  |  2.7 KB  |  92 lines

  1. VERSION 5.00
  2. Begin VB.Form frmLogin 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Login"
  5.    ClientHeight    =   1155
  6.    ClientLeft      =   2835
  7.    ClientTop       =   3435
  8.    ClientWidth     =   3750
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   682.412
  13.    ScaleMode       =   0  'User
  14.    ScaleWidth      =   3521.047
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.TextBox txtUserName 
  18.       Height          =   345
  19.       Left            =   1290
  20.       TabIndex        =   0
  21.       Top             =   135
  22.       Visible         =   0   'False
  23.       Width           =   2325
  24.    End
  25.    Begin VB.CommandButton cmdOK 
  26.       Caption         =   "OK"
  27.       Default         =   -1  'True
  28.       Height          =   390
  29.       Left            =   495
  30.       TabIndex        =   3
  31.       Top             =   660
  32.       Width           =   1140
  33.    End
  34.    Begin VB.CommandButton cmdCancel 
  35.       Cancel          =   -1  'True
  36.       Caption         =   "Cancel"
  37.       Height          =   390
  38.       Left            =   2100
  39.       TabIndex        =   4
  40.       Top             =   660
  41.       Width           =   1140
  42.    End
  43.    Begin VB.TextBox txtPassword 
  44.       Height          =   345
  45.       IMEMode         =   3  'DISABLE
  46.       Left            =   1290
  47.       PasswordChar    =   "*"
  48.       TabIndex        =   2
  49.       Top             =   165
  50.       Width           =   2325
  51.    End
  52.    Begin VB.Label lblLabels 
  53.       Caption         =   "&Password:"
  54.       Height          =   270
  55.       Index           =   1
  56.       Left            =   105
  57.       TabIndex        =   1
  58.       Top             =   180
  59.       Width           =   1080
  60.    End
  61. Attribute VB_Name = "frmLogin"
  62. Attribute VB_GlobalNameSpace = False
  63. Attribute VB_Creatable = False
  64. Attribute VB_PredeclaredId = True
  65. Attribute VB_Exposed = False
  66. Option Explicit
  67. Public LoginSucceeded As Boolean
  68. Private Sub cmdCancel_Click()
  69.     'set the global var to false
  70.     'to denote a failed login
  71.     LoginSucceeded = False
  72.     Me.Hide
  73. End Sub
  74. Private Sub cmdOK_Click()
  75.     'check for correct password
  76.     If txtPassword = txtUserName.Text Then
  77.         'place code to here to pass the
  78.         'success to the calling sub
  79.         'setting a global var is the easiest
  80.         LoginSucceeded = True
  81.         Me.Hide
  82.         frmOptions.Show
  83.     Else
  84.         MsgBox "Invalid Password, try again!", , "Login"
  85.         txtPassword.SetFocus
  86.         SendKeys "{Home}+{End}"
  87.     End If
  88. End Sub
  89. Private Sub Form_Load()
  90. txtUserName.Text = GetSetting(App.Title, "Lockdown", "password")
  91. End Sub
  92.