1、按键盘上的任何键都没有反应(如果鼠标点击窗体,那么就会显示3 6 9 12 ,每行一个)
2、在文本框里面按下a键的话,会在窗体上显示6个大写的A
3、大于等于应该是>=
4
Private Sub Command1_Click()a = 0 '两个正的次数
b = 0 '两个反的次数
c = 0 '一正一反的次数
m = 0 '硬币1的正反面
n = 0 '硬币2的正反面
Randomize '置随机种子
For i = 1 To 100
m = Rnd() '随机产生0到1之间的数
n = Rnd()
If (m < 05) And (n < 05) Then
a = a + 1
ElseIf (m >= 05) And (n >= 05) Then
b = b + 1
Else
c = c + 1
End If
Next
Print "两个正面为:" + Str(a) + "次"
Print "两个方面为:" + Str(b) + "次"
Print "一正一反为:" + Str(c) + "次"
End Sub
很容易做啊 这些
第一题:
Private Sub Command1_Click()
Text2 = Format(Sqr((2 Val(Text1) / 98)), "000000000000000")
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Label1Caption = "塔高:"
Label2Caption = "时间:"
Form1Caption = "求落地时间"
Command1Caption = "计算"
Command2Caption = "退出"
Text1 = ""
Text2 = ""
End Sub
第二题
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Form1Caption = "改变背景"
Command1Caption = "结束"
Timer1Interval = 100
End Sub
Private Sub Timer1_Timer()
Randomize
Form1BackColor = RGB(Int(Rnd 255), Int(Rnd 255), Int(Rnd 255))
End Sub
第三题
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Form1Caption = "位置随机变化的"
Command1Caption = "退出"
End Sub
Private Sub Picture1_Click()
Randomize
Picture1Left = Rnd() (Form1Width - Picture1Width)
Picture1Top = Rnd() (Form1Height - Picture1Height)
End Sub
第四题
Private Sub Command1_Click()
If Text1 > Text2 Then
Text3 = Text1
Else
Text3 = Text2
End If
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Private Sub Form_Load()
Label1Caption = "a="
Label2Caption = "b="
Label3Caption = "最大数="
Form1Caption = "求最大数"
Command1Caption = "比较"
Command2Caption = "清除"
Text1 = ""
Text2 = ""
Text3 = ""
Text3Locked = True
Text3BackColor = &H8000000F
End Sub
滚动条的Value属性取值范围是依据滚动条中的max属性和min属性来判断的。。。Call cale(hvValue, htValue) 就是将滑块(value的当前值)的值变成x,y的值。。。。
以上就是关于很简单的几个VB程序,帮忙解答下,谢谢全部的内容,包括:很简单的几个VB程序,帮忙解答下,谢谢、简单的VB程序~~~懂得进~~~帮下忙~~、一个简单的vb程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)