VB程序 如何让您好在前面显示Picture1.Print s & ",您好!" & vbCrLf & "欢迎进入本系统!"
VB程序如何让您好在前面显示Picture1.Prints&",您好!"&vbCrLf&"欢迎进入本系统!"OptionExplicitPrivateSubForm_Lo...
VB程序 如何让您好在前面显示Picture1.Print s & ",您好!" & vbCrLf & "欢迎进入本系统!"
Option Explicit
Private Sub Form_Load()
Dim i As Integer
Dim strEn(1 To 3) As String
Dim bolYES As Boolean
Dim s As String
strEn(1) = "user1"
strEn(2) = "user2"
strEn(3) = "user3"
bolYES = False '先将标志置为假
s = InputBox("请输入您的用户名", "身份确认", "")
s = LCase(s) '若执行此语句则不区分大小写
For i = 1 To 3
If s = strEn(i) Then bolYES = True '若检测到符合的用户名,则将标志改为真
Next i
If bolYES Then
Picture1.AutoRedraw = True
Picture1.FontSize = 18
Picture1.Print s & ",您好!" & vbCrLf & "欢迎进入本系统!"
Else
MsgBox "您的用户名错误!" & vbCrLf & "系统将自动退出……", vbCritical + vbOKOnly, "错误"
Unload Me
End If
End Sub 展开
Option Explicit
Private Sub Form_Load()
Dim i As Integer
Dim strEn(1 To 3) As String
Dim bolYES As Boolean
Dim s As String
strEn(1) = "user1"
strEn(2) = "user2"
strEn(3) = "user3"
bolYES = False '先将标志置为假
s = InputBox("请输入您的用户名", "身份确认", "")
s = LCase(s) '若执行此语句则不区分大小写
For i = 1 To 3
If s = strEn(i) Then bolYES = True '若检测到符合的用户名,则将标志改为真
Next i
If bolYES Then
Picture1.AutoRedraw = True
Picture1.FontSize = 18
Picture1.Print s & ",您好!" & vbCrLf & "欢迎进入本系统!"
Else
MsgBox "您的用户名错误!" & vbCrLf & "系统将自动退出……", vbCritical + vbOKOnly, "错误"
Unload Me
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询