mdsk.net
当前位置:首页 >> vB程序设计登录程序:在窗体的文本框中输入密码. >>

vB程序设计登录程序:在窗体的文本框中输入密码.

'2个窗体(form1,form2) 2个textbox(text1,text2) 1个commandbutton (command1) 'text1 为账号框,text2为密码框,command1为登录按钮 Dim cCount As Long Private Sub Command1_Click() If LCase(Text1.Text) = "abc" And Text2.Text = "123" Then...

先设计好界面,(如:用标签控件,2个文本框,)在1个要输密码文本框的属性名称中输入password,在要输入名称的文本框的属性名称中输入username.在设置字体 想要输入错误密码三次退出程序方法如下; 在密码的代码框中输入:unload.me chick=3. En...

建立一个text1,一个command1控件 复制下面的代码,F5运行. Private Sub Command1_Click() If Text1 = "Basic1234" Then MsgBox "祝贺你,成功登录" Else MsgBox "对不起,密码错误,无法登录!" End If End Sub

Public Sub Form_Load() Timer1.Interval = 1000 Label1.Caption = "当前时间" Text1.Alignment = 2 End Sub Private Sub Timer1_Timer() Text1.Text = Format(Time, "hh:mm:ss") End Sub

Private Sub Form_Click() Dim a As Integer, b As Integer, i As Integer If Text1 "" Then a = Val(Text1) If a < 100 Or a > 999 Then GoTo 1234 Else1234 MsgBox "请在文本框中输入一个三位数字!", vbOKOnly + vbCritical Text1.Text = "" T...

窗体是一个模块,其实也就是一个窗体类,当运行实例化后就是一个对象。

Option ExplicitDim s(9) As Long Private Sub Command1_Click() Dim i As Long For i = 1 To 9 PaiXu i Next Text2.Text = "" For i = 0 To 9 Text2.Text = Text2.Text & s(i) & "," Next End Sub Private Sub Form_Load() Dim i As Long Text1...

Private Sub Form_Click() Dim n As Integer If IsNumeric(Text1.Text) Then n = Val(Text1.Text) Select Case n Case 0 Text2.Text = "Sunday" Case 1 Text2.Text = "Monday" Case 2 Text2.Text = "Tuesday" Case 3 Text2.Text = "Wednesday" C...

Private Sub Command1_Click() If Text1.Text = "abcde" Then Form2.Show Else Label1.Caption = "请重新输入" Text1.Text = "" Text1.SetFocus End If End Sub Private Sub Form_Load() Text1.Text = "" Text1.PasswordChar = "*" Label1.Capti...

Private Sub cmdOK_Click() Static interr As Integer Dim suser As String Dim spass As String suser = UCase$(Trim$(txtUser.Text)) spass = Trim$(txtPassword.Text) If suser = "ADMIN" And spass = "123456" Then frmMain.Show Unload Me ...

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com