^^ 创建setup类型的进度条(vb6) ^^
加入下面的代码: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