^^ 创建setup类型的进度条(vb6) ^^
来源:互联网 发布:青岛网络问政平台 编辑:程序博客网 时间:2024/06/13 15:30
^^ 创建setup类型的进度条(vb6) ^^
- 新建一个工程
- 增加一个picture box和command button
加入下面的代码:Dim tenth As Long'条件编译#If Win32 ThenPrivate Declare Function BitBlt Lib "gdi32" _(ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, _ByVal nWidth As Long, ByVal nHeight As Long, _ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, _ByVal dwRop As Long) As Long#ElsePrivate Declare Function BitBlt Lib "GDI" (ByVal hDestDC As _Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth _As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, _ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As _Long) As Integer#End IfSub UpdateStatus(FileBytes As Long)'--------------------------------------------------------------------' 更新Picture1 status bar'-------------------------------------------------------------------- Static progress As Long Dim r As Long Const SRCCOPY = &HCC0020 Dim Txt$ progress = progress + FileBytes If progress > Picture1.ScaleWidth Then progress = Picture1.ScaleWidth End If Txt$ = Format$(CLng((progress / Picture1.ScaleWidth) * 100)) + "%" Picture1.Cls Picture1.CurrentX = _ (Picture1.ScaleWidth - Picture1.TextWidth(Txt$)) / 2 Picture1.CurrentY = _ (Picture1.ScaleHeight - Picture1.TextHeight(Txt$)) / 2 Picture1.Print Txt$ Picture1.Line (0, 0)-(progress, Picture1.ScaleHeight), _ Picture1.ForeColor, BF r = BitBlt(Picture1.hDC, 0, 0, Picture1.ScaleWidth, _ Picture1.ScaleHeight, Picture1.hDC, 0, 0, SRCCOPY)End SubPrivate Sub Command1_Click() Picture1.ScaleWidth = 109 tenth = 10 For i = 1 To 11 Call UpdateStatus(tenth) x = Timer While Timer < x + 0.75 DoEvents Wend NextEnd SubPrivate Sub Form_Load() Picture1.FontBold = True Picture1.AutoRedraw = True Picture1.BackColor = vbWhite Picture1.DrawMode = 10 Picture1.FillStyle = 0 Picture1.ForeColor = vbBlueEnd Sub
- F5 运行, 点击 Command1就可以看到效果.
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=5691
- ^^ 创建setup类型的进度条(vb6) ^^
- ^^ 创建setup类型的进度条(vb6) ^^
- ^^ 创建setup类型的进度条(vb6)
- 双色进度条控件,很酷的效果 开发:VB6
- VB6调用Windows7任务栏进度条的ITaskbarList3接口
- 【原创】VB6.0应用程序安装包的生成(Setup Factory 9.0制作安装包的方法)
- 进度条的创建与使用
- Android ProgressBar进度条的创建
- bootstrap创建带遮罩层的进度条
- INNO SETUP数据库的连接与创建
- VB6--RECORDSET游标类型
- VB6中ByRef 参数类型不正确的处理方法
- VB6 自动创建 ODBC
- 【VB6】动态创建RichTextBox
- vb6.0 excel连接的创建,内容的读取
- 利用vb6创建一个简单的ole db提供者
- 解决vb6 Active不能创建对象的方法
- vb6创建子进程并等待子进程的退出。
- Ultraedit的SQL Server语法着色模板
- 组合处理
- 安装软件提示缺少perl模块的解决方法
- 对反病毒产品你应该知道的几个事实
- 数据汇总加排序
- ^^ 创建setup类型的进度条(vb6) ^^
- 动态分组查询
- 还你一个清爽的迅雷,
- Mesh+交换机混合拓扑实验网络配置
- 作业中,调用DTS包的问题
- 组合处理
- SQL SERVER 2000 中的标识值获取函数
- 根据表中记录的变化情况自动维护作业
- 根据排序定义表排序数据