form1上放置Command1,Timer1,Picture1(装入一个)
Dim MoveStep As Integer
Private Sub Command1_Click()
Timer1Enabled = False
End Sub
Private Sub Form_Load()
MoveStep = 100
End Sub
Private Sub Timer1_Timer()
If Picture1Left + Picture1Width + 30 > Form1Width Then
MoveStep = -100
End If
If Picture1Left < 0 Then
MoveStep = 100
End If
Picture1Left = Picture1Left + MoveStep
End Sub
Option Explicit
Private Sub Form_Load()
Randomize
Label1Caption = Int((Rnd (999999 - 100000 + 1)) + 100000) '生成100000-999999之间的随机数
Timer1Interval = 1000 '一秒一次
Timer1Enabled = True
End Sub
Private Sub Timer1_Timer()
Static n As Integer
n = n + 1
If n = 60 Then '一秒一次,累加到60此即60秒
n = 0
Randomize
Label1Caption = Int((Rnd (999999 - 100000 + 1)) + 100000)
End If
End Sub
有问题请追问,,加油!
PrivateSubCommand1_Click()
Label1=""
IfOption1Value=TrueThenLabel1=Label1&""&Option1Caption
IfOption2Value=TrueThenLabel1=Label1&""&Option2Caption
IfOption3Value=TrueThenLabel1=Label1&""&Option3Caption
IfOption4Value=TrueThenLabel1=Label1&""&Option4Caption
IfOption5Value=TrueThenLabel1=Label1&""&Option5Caption
IfOption6Value=TrueThenLabel1=Label1&""&Option6Caption
IfOption7Value=TrueThenLabel1=Label1&""&Option7Caption
IfOption8Value=TrueThenLabel1=Label1&""&Option8Caption
IfCheck1Value=1ThenLabel1=Label1&""&Check1Caption
IfCheck2Value=1ThenLabel1=Label1&""&Check2Caption
IfCheck3Value=1ThenLabel1=Label1&""&Check3Caption
EndSub
PrivateSubCommand2_Click()
Label1=""
EndSub
PrivateSubCommand3_Click()
End
EndSub
(输入5个成绩,求合格,不合格人数和平均分)
Dim a(1 to 5)As Integer
For i=1 to 5
a(i)=Inputbox(" "," ")
Next i
t=0
For j=1 to 5
If a(j)>=60 then
t=t+1
end if
s=s+a(j)/5
text1text=t
text2text =5-t
text3text =s
(用函数了哟,我个人认为不是很难)
Private Sub Command1_Click()
Open "C:\Documents and Settings\Administrator\桌面\fafa中英文混合txt" For Input As #1
Do Until EOF(1)
Line Input #1, fafa
Text1 = Text1 & fafa & vbCrLf
Loop
Close #1
End Sub
Private Sub Command2_Click()
s = Len(Text1)
For i = 1 To s
'Text2 = Text2 & Asc(Mid(Text1, i, 1)) & " : "
If Asc(Mid(Text1, i, 1)) < 1 Then
Text2 = Text2 & Mid(Text1, i, 1)
Open "C:\Documents and Settings\Administrator\桌面\fafa中英文混合2txt" For Output As #1
Print #1, Text2
Close #1
End If
Next i
End Sub
以上就是关于怎样用 VB 制作个简单的小程序全部的内容,包括:怎样用 VB 制作个简单的小程序、用VB制作小程序、用VB6.0设计一个购买苹果产品的小程序,要求见图等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)