vb 写的简单点谢谢
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim dama As Integer
dama = KeyAscii
Print dama
Select Case dama
Case 48 To 57
Picture1.Print "数字"
Case 65 To 90
Picture1.Print "大写字母"
Case 97 To 122
Picture1.Print "小写字母"
Case 58 To 64
Picture1.Print "其它"
Case 91 To 96
Picture1.Print "其它"
Case Is < 47
Picture1.Print "其它"
Case Is > 123
Picture1.Print "其它"
End Select
End Sub
Private Sub Command1_Click()
Dim i%,j%,k%,n%,u%
For i = 351 To 432
j = i Mod 3
k = i Mod 8
If j0 and k0 then
n = n + 1 '个数
u=u+i '和
endif
next i
Print n,u 'n为个数,u为和
end sub
个数为47,和为18413
Private Sub Command1_Click()
Dim s As String, n As Integer
s = Left(Text1.Text, 1)
n = Asc(s)
If n >= 48 And n <= 57 Then
Text2.Text = Text2.Text & "数字字符"
ElseIf n >= 65 And n <= 90 Then
Text2.Text = Text2.Text & "大写字母"
ElseIf n >= 97 And n <= 122 Then
Text2.Text = Text2.Text & "小写字母"
Else
Text2.Text = Text2.Text & "其他"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub
刀烁乙肝: 插入三个文本框a1、a2、a3来接收输入的三个数,插入一个按钮a4来执行操作,最后用三个文本框来显示结果.Private Sub a4_Click()Dim v1, v2, v3, t As Singlev1 = a1.Valuev2 = a2.Valuev3 = a3.Value...
茂南区17297273981: vb 写的简单点,谢谢 - ?
刀烁乙肝: Private Sub Text1_KeyPress(KeyAscii As Integer) Dim dama As Integer dama = KeyAscii Print dama Select Case dama Case 48 To 57 Picture1.Print "数字" Case 65 To 90 Picture1.Print "大写字母" Case 97 To 122 Picture1.Print "小写字...
茂南区17297273981: 告诉我一些简单的vb编程代码 - ?
刀烁乙肝: uEnd是用户定义捕捉VB输出框(MsgBox)按下按钮事件一个变量.即你的原代码 MsgBox "您确定要离开吗?", vbYesNo + vbQuestion, "离开程序"执行按vbYes或vbNo按钮的结果...
茂南区17297273981: 简单的VB代码..... - ?
刀烁乙肝: Function opentable(byval txtPath as string) '【功能:建立数据库连接;状态:完成】 Set conn = New ADODB.Connection conn.CursorLocation = adUseClient conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & txtPath & ";...
茂南区17297273981: 求一个简单vb编程实例~ - ?
刀烁乙肝: 控件: image,picture,timer 代码: Dim x As Integer Dim y As Integer Private Sub Form_Load() x = 100 y = 100 Timer1.Interval = 100 End Sub Private Sub Timer1_Timer() If img.Top >= pic.Height - img.Height Then y = -100 End If If img.Top <= 0 ...
茂南区17297273981: 求编写一个简单的VB程序 - ?
刀烁乙肝: Option Explicit Dim k As Integer Private Sub Form_Load() Timer1.Interval = 1000 Label1.Caption = "你想说的话" Label1.Font = "宋体" k = 9 End Sub Private Sub Timer1_Timer() k = k + 1 If k = 16 Then k = 8 Label1.FontSize = k End Sub
茂南区17297273981: 求 VB 的一个简单代码 - ?
刀烁乙肝: Private Sub Command1_Click() If Command1.Caption = "关闭游戏" Then Command1.Caption = "开启游戏" Else Command1.Caption = "关闭游戏" End If End Sub Private Sub Form_Load() Command1.Caption = "关闭游戏" End Sub
茂南区17297273981: 求做一个最简单的vb计算公式程序的代码 - ?
刀烁乙肝: 一、设置控件属性 text1(被除数):text=(空) label1:caption=“/” text2(除数):text=(空) label2:caption=“=” text3(商):text=(空) command1:caption=“计算” command2:caption=“清空” 二、编写代码 Private Sub Command...
茂南区17297273981: 计算器的VB程序代码 简单的 - ?
刀烁乙肝: Dim op As StringDim a As StringDim b As StringDim c As StringDim d As Single, e As SingleDim f As SingleConst u = 3.141592653Private Sub Command1_Click(Index As Integer)Select Case IndexCase 0 To 9Text1.Text = Text1.Text & ...
茂南区17297273981: 请求简单的vb代码 - ?
刀烁乙肝: print 1234 '在窗体上打印1234 debug.print 1234 '在调试窗口打印1234