home *** CD-ROM | disk | FTP | other *** search
/ distrib.akp.su/Programming/Vb-6+Rus/ / distrib.akp.su.tar / distrib.akp.su / Programming / Vb-6+Rus / VB98 / TEMPLATE / FORMS / LOGINDLG.FRM (.txt) < prev    next >
Visual Basic Form  |  1998-06-18  |  3KB  |  95 lines

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