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