【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,Form_Logon.frm,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form Form_Logon
BorderStyle = 1 'Fixed Single
Caption = "登录"
ClientHeight = 1470
ClientLeft = 45
ClientTop = 330
ClientWidth = 2715
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1470
ScaleWidth = 2715
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 255
Left = 1440
TabIndex = 5
Top = 1080
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确 定"
Default = -1 'True
Height = 255
Left = 120
TabIndex = 4
Top = 1080
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 960
PasswordChar = "*"
TabIndex = 1
Top = 600
Width = 1575
End
Begin VB.TextBox Text1
Height = 270
Left = 960
TabIndex = 0
Top = 120
Width = 1575
End
Begin
VB.Label Label2
Alignment = 2 'Center
Caption = "密 码"
Height = 255
Left = 0
TabIndex = 3
Top = 645
Width = 855
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "用户名"
Height = 255
Left = 0
TabIndex = 2
Top = 165
Width = 855
End
End
Attribute VB_Name = "Form_Logon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim UserName As String
Dim Password As String
Private Sub Command1_Click()
If UserName = Text1.Text Then
If Pass
word = Text2.Text Then
Form_Main.Show
Unload Form_Logon
Else: MsgBox ("密码错误")
End If
Else: MsgBox ("用户名错误")
End If
End Sub
Private Sub Command2_Click()
Unload Form_Logon
End Sub
Private Sub Form_Load()
UserName = "cwadmin"
Password = "111"
End Sub