♣
新手提问.
请问各位前辈,怎样才能在statusbar中显示程序执行进度?就像ie中那样 谢谢
· 网友精彩回答:
还要有一个progressbar
用api函数setparent把它放进statusbar里面。
需要一个form\timer\commandbutton\progressbar\statusbar
option explicit
private declare function setparent lib "user32" (byval hwndchild as long, byval hwndnewparent as long) as long
private declare function sendmessage lib "user32" alias "sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, lparam as any) as long
private const wm_user = &h400
private const sb_getrect = (wm_user + 10)
private type rect
left as long
as long
right as long
bottom as long
end type
private sub command1_click()
showprogressinstatusbar true
timer1.enabled = true
end sub
private sub showprogressinstatusbar(byval bshowprogressbar as boolean)
dim trc as rect
if bshowprogressbar then
sendmessage statusbar1.hwnd, sb_getrect, 1, trc
with trc
. = (. * screen.twipsperpixely) - 5
.left = (.left * screen.twipsperpixelx)
.bottom = (.bottom * screen.twipsperpixely) - . - 10
.right = (.right * screen.twipsperpixelx) - .left
end with
with progressbar1
setparent .hwnd, statusbar1.hwnd
.move trc.left, trc., trc.right, trc.bottom
.visible = true
.value = 1
end with
else
setparent progressbar1.hwnd, me.hwnd
progressbar1.visible = false
end if
end sub
private sub form_load()
with timer1
.enabled = false
.interval = 10
end with
end sub
private sub timer1_timer()
if progressbar1.value = 100 then
timer1.enabled = false
showprogressinstatusbar false
else
progressbar1.value = progressbar1.value + 1
end if
end sub
- 更多问题:
- · 一个数据库同步的问题,感谢大家解答,比较有挑战性,必给分
- · 在用tc2.0进入图形方式的问题(百思不得其解)
- · 如何选择出指定行之间的纪录??大虾帮忙~
- · ACCESS与MYSQL数据库同步的问题!!必送分
- · SQL安装的时候出现这个问题,急救
- · ASP.NET web 应用程序如何调用其他程序
- · 如何用TImage的Canvas作一个点?
- · 求asp网站的打包加密解决方案
- · 创建视图时可否对某个表的某一项进行操作,如取其字符串的前三位?急急急
- · VB中如何往自己开发的自定义控件中加入属性、方法和事件?
- · excel
- · 最近缺钱花了
- · 求SQL?(最有效的方法)
- · Java 中显示图片 的问题...就是路径的问题?
- · 请给推荐一个写ASP的编辑软件!
- · select top 的问题~~来帮帮我啊~~~!!!

