Private Sub Command1_Click() If Text1.Text = "admin" And Text2.Text = "admin" Then Form1.Hide Form3.Show Else If Text1.Text = "admin" Then MsgBox ("你输入的密码有误") Text2.Text = "" Text2.SetFocus Else MsgBox ("你输入的帐号不存在") Text1.Text = "" Text1.SetFocus En
Private Sub Command1_Click() If Text1.Text = "1" And Text2.Text = "1" Then Form1.Visible = False Form2.Visible = True Else MsgBox "密码有误或用户不存在,请重试!" Text2.Text = "" End If End Sub Private Sub Command2_Click( ) Text1.Text = "" Text2.Text = "" End Sub
VB关机程序--包括注销、重启、关机。 附:(源码) Option Explicit Private Declare Function GetCurrentProcess Lib "kernel32" () As Long Private Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long)
Private Sub Command1_Click() On Error Resume Next Dim wApp As New Application Dim wDoc As Document Dim wNewTable As Table Set wDoc = wApp.Documents.Add Selection.Range Set wNewTable = wDoc.Tables.Add(wDoc.Range, MSHFlexGrid1.Rows, MSHFlexGrid1.Co ls
Private Sub Command1_Click() X = Text1.Text If Text1.Text = "" Then MsgBox "输入源数据", 0, "" If Option1 = True And Option5 = True Then MsgBox "请选不同的进制", 0, "" If Option2 = True And Option6 = True Then Ms gBox "请选不同的进制", 0, "" If Option3 = True And Opti
此矩阵相当好。Private Sub Command1_Click() Dim i%, j% For i = 1 To 7 For j = 1 To 7 'a(i, j) = Int(Rnd * (3 * i + 4 * j)) + 30 ' b(i, j) = Int(Rnd * (3 * i + 4 * j)) + 100 c(i, j) = a(i, j) + b(i, j) Next j Next i For i = 1 To 7 For j = 1 To 7 'Picture1.Pr
Dim TempTime As String Private Sub Command1_Click() Dim Ret As String If Trim(Text3.Text) = "" Then Text3.Text = 0 End If TempTime = Timer Ret = EncryptFile(Trim(Text1.Text), Trim(Text2.Text), Trim(Text3.Text)) Debug.Print Timer - TempTime Me.Captio
VB内嵌控件的使用, Private WithEvents mobjTest As UserControl1 Private mobjCtl As Control Private Sub Command1_Click() Call mobjTest.Test End Sub Private Sub Form_Load() Set mobjCtl = Me.Controls.Add("工程1.usercontrol1", "ctl1" ) mobjCtl.Move 120, 120 mobjCt
Private Sub Command1_Click() Dim conn As New ADODB.Connection Dim s As String Dim rs As New ADODB.Recordset Dim telephone As String Dim txtsql As String telephone = Trim(Text1.Text) '**************************************************************** *
Dim addition As Integer Private Sub Command1_Click() 'LED1.SetLineWidth (CInt(Text1.Text)) LED1.LEDSIZE = CInt(Text1.Text) End Sub Private Sub Command2_Click() LED1.LEDWIDTH = CInt(Text2.Text) End Sub Private Sub Command3_Click() LED1.LEDXYRATE = CV