VB程序代码(简单小程序)-.pdf
《VB程序代码(简单小程序)-.pdf》由会员分享,可在线阅读,更多相关《VB程序代码(简单小程序)-.pdf(3页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、实验一:(带有进度条的倒计时程序)PublicClass Form1 Dim timers As Integer Dim temp As Integer PrivateSub Timer1_Tick(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Timer1.Tick If(ProgressBar1.Value+ProgressBar1.Maximum/timers ProgressBar1.Maximum)Then ProgressBar1.Value+=ProgressBar1.Maximum/timer
2、s Else Timer1.Enabled=False ProgressBar1.Value=ProgressBar1.Maximum MessageBox.Show(进度完成!)End If temp+=1 Label1.Text=temp.ToString()End Sub PrivateSub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesMyBase.Load timers=30 End Sub PrivateSub Button2_Click(ByVal sender As Sy
3、stem.Object,ByVal e AsSystem.EventArgs)Handles Button2.Click timers=Val(InputBox(输入 ,请输入总时间。,30,0,0)End Sub PrivateSub Button1_Click(ByVal sender As System.Object,ByVal e AsSystem.EventArgs)Handles Button1.Click Timer1.Enabled=True End Sub End Class 实验二(定时器控制蝴蝶飞舞)PublicClass Form1 Dim t As Integer P
4、rivateSub Timer1_Tick(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Timer1.Tick Dim t As Boolean If t=True Then PictureBox3.Image=PictureBox2.Image t=False Else PictureBox3.Image=PictureBox1.Image t=True End If SelectCase t Case 0 PictureBox3.Image=PictureBox1.Image t=1 Case 1 Pi
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VB 程序代码 简单 程序
限制150内