📄 frm_swapuser.frm
字号:
VERSION 5.00
Begin VB.Form Frm_SwapUser
BorderStyle = 3 'Fixed Dialog
Caption = "切换用户"
ClientHeight = 2520
ClientLeft = 45
ClientTop = 435
ClientWidth = 4710
Icon = "Frm_SwapUser.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2520
ScaleWidth = 4710
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox Pic_TitleBar
Align = 1 'Align Top
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 720
Left = 0
ScaleHeight = 720
ScaleWidth = 4710
TabIndex = 5
Top = 0
Width = 4710
Begin VB.PictureBox Pic_TBarSymbol
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 120
Picture = "Frm_SwapUser.frx":058A
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 6
Top = 120
Width = 480
End
Begin VB.Label Lbl_TBarText
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "选择用户名并输入密码可快速切换至其它用户"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 195
Left = 720
TabIndex = 8
Top = 405
Width = 3600
End
Begin VB.Label Lbl_TBarTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "TitleBar Title"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 195
Left = 720
TabIndex = 7
Top = 165
Width = 1080
End
End
Begin LabMangeSystem.XButton Cmd_Change
Height = 375
Left = 1680
TabIndex = 2
Top = 1920
Width = 1335
_ExtentX = 2355
_ExtentY = 661
Caption = "切换用户"
BackColor = 14737632
ForeColor = 8421504
MouseDownColor = -2147483644
MouseOnColor = -2147483644
StyleColor = 16777215
Style3dColor1 = 16577259
Style3dColor2 = 8421504
Picture = "Frm_SwapUser.frx":1C74
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
IfDraw = -1 'True
End
Begin LabMangeSystem.FTextBox Txt_Password
Height = 300
Left = 1440
TabIndex = 1
Top = 1440
Width = 2415
_ExtentX = 4260
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "Tahoma"
FontSize = 8.25
ForeColor = 0
Text = "0000"
PasswordChar = "*"
AutoSelAll = -1 'True
End
Begin LabMangeSystem.FCombo Cmb_UID
Height = 315
Left = 1440
TabIndex = 0
Top = 960
Width = 2415
_ExtentX = 4260
_ExtentY = 556
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BackColor = 16777215
ListIndex = -1
End
Begin VB.Label Lbl_Password
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 840
TabIndex = 4
Top = 1500
Width = 540
End
Begin VB.Label Lbl_UID
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 840
TabIndex = 3
Top = 1020
Width = 540
End
End
Attribute VB_Name = "Frm_SwapUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Cmd_Change_Click()
If Login(Cmb_UID.Text, Txt_Password.Text) = True Then
Call Frm_Main.InitToolBar
Unload Me
Unload LastForm
LastForm.Show
Else
MsgFrm "用户名或密码错误!", "x", "登录失败"
Txt_Password.SetFocus
End If
End Sub
Private Sub Form_Load()
Dim sty As Long
sty = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
sty = sty Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, sty
SetLayeredWindowAttributes Me.hwnd, 0, 192, LWA_ALPHA
Lbl_TBarTitle.caption = Me.caption
Call LoadData
End Sub
Private Sub Txt_Password_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call Cmd_Change_Click
End Sub
Private Sub LoadData()
On Error Resume Next
Dim i As Integer
Dim strSQL As String
Dim rs As New ADODB.Recordset
strSQL = "SELECT DISTINCT 用户名 FROM 账户"
rs.Open strSQL, cnMain, 1, 1
Do While Not rs.EOF
Cmb_UID.AddItem rs("用户名")
rs.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -