?? frmusername.frm
字號:
VERSION 5.00
Begin VB.Form frmUserName
BorderStyle = 3 'Fixed Dialog
Caption = "用戶信息"
ClientHeight = 1605
ClientLeft = 45
ClientTop = 330
ClientWidth = 3660
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1605
ScaleWidth = 3660
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 2520
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.TextBox txtUserName
Height = 300
Left = 1080
TabIndex = 1
Top = 600
Width = 2415
End
Begin VB.TextBox txtUserLogin
Height = 300
Left = 1080
TabIndex = 0
Top = 120
Width = 2415
End
Begin VB.CommandButton cmdOK
Caption = "確定(&O)"
Height = 375
Left = 1560
TabIndex = 2
Top = 1080
Width = 975
End
Begin VB.Label lblUserName
Caption = "用戶名稱:"
Height = 165
Left = 120
TabIndex = 5
Top = 668
Width = 975
End
Begin VB.Label lblUserLogin
Caption = "用戶工號:"
Height = 160
Left = 120
TabIndex = 4
Top = 190
Width = 975
End
End
Attribute VB_Name = "frmUserName"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public m_sLogin As String
Public m_sName As String
Public m_bCancel As Boolean
Public Sub Init()
On Error Resume Next
txtUserLogin.Text = m_sLogin
txtUserName.Text = m_sName
txtUserLogin.SetFocus
End Sub
Private Sub cmdCancel_Click()
On Error Resume Next
m_bCancel = True
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
If Trim$(txtUserLogin.Text) = "" Then
MsgBox "員工工號不能為空!", vbOKOnly, "系統提示"
Exit Sub
End If
m_sLogin = txtUserLogin.Text
m_sName = txtUserName.Text
m_bCancel = False
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
m_bCancel = True
m_sLogin = ""
m_sName = ""
End Sub
Private Sub Form_Terminate()
On Error Resume Next
Set frmUserName = Nothing
End Sub
Private Sub txtUserLogin_GotFocus()
On Error Resume Next
txtUserLogin.BackColor = &H80000018
End Sub
Private Sub txtUserLogin_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回車鍵?
KeyAscii = 0 '0取消輸入
SendKeys "{tab}"
End If
End Sub
Private Sub txtUserLogin_LostFocus()
On Error Resume Next
txtUserLogin.BackColor = &H80000005
End Sub
Private Sub txtUserName_GotFocus()
On Error Resume Next
txtUserName.BackColor = &H80000018
End Sub
Private Sub txtUserName_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回車鍵?
KeyAscii = 0 '0取消輸入
SendKeys "{tab}"
End If
End Sub
Private Sub txtUserName_LostFocus()
On Error Resume Next
txtUserName.BackColor = &H80000005
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -