VB状态栏上面可以放置进度条吗?

cooler 2006-05-05 04:58:03
我想在一个MDI窗体的状态拦上放置进度条。但是死活放不上去,鼠标一松开,就自己跑到窗体的最上面去了。我也参考了CSDN的以前的帖子,好像大家都说可以。
...全文
329 点赞 收藏 11
写回复
11 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
cooler 2006-06-27
谢谢。我试试看
回复
Random 2006-06-27
用我做的状态栏可以实现你的功能
也可以在MDI窗体底部放一个PictureBox,然后把状态栏和进度条都放PictureBox里。但要自己控制状态栏的大小。
回复
risa_meng 2006-06-27
我没在状态栏上面做过哦,我也不知道,关注
回复
wwh999 2006-06-27
关注!
回复
半截烟头 2006-06-27
to hpygzhx520() :
你说的这个方法我试过了,非MID窗口可以,但MDI窗口不行,move不上去
回复
羽毛之家 2006-06-27
可以的!
回复
vansoft 2006-06-21
可以做到的。
回复
hpygzhx520 2006-06-21

Private defProgBarHwnd As Long

Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Function AttachProgBar(pb As ProgressBar, _
sb As StatusBar, _
nPanel As Long, _
pading As Long)

If defProgBarHwnd = 0 Then

'change the parent
defProgBarHwnd = SetParent(pb.hwnd, sb.hwnd)

With sb

'adjust statusbar. Doing it this way
'relieves the necessity of calculating
'the statusbar position relative to the
'top of the form. It happens so fast
'the change is not seen.
.Align = vbAlignTop
.Visible = False

'change, move, set size and re-show
'the progress bar in the new parent
With pb
.Visible = False
.Align = vbAlignNone
.Appearance = ccFlat
.BorderStyle = ccNone
.Width = sb.Panels(nPanel).Width
.Move (sb.Panels(nPanel).Left + pading), _
(sb.Top + pading), _
(sb.Panels(nPanel).Width - (pading * 2)), _
(sb.Height - (pading))

.Visible = True
.ZOrder 0
End With

'restore the statusbar to the
'bottom of the form and show
.Panels(nPanel).AutoSize = sbrNoAutoSize
.Align = vbAlignBottom
.Visible = True

End With

End If

End Function

Private Sub Command1_Click()
Dim pading As Long
'parent the progress bar in the status bar
pading = 40
AttachProgBar ProgressBar1, StatusBar1, 2, pading
End Sub

但编译后需要在不同分辨率下测试看是否正常,个人认为效果不是非常理想
回复
cooler 2006-06-21
没有人回答吗?请教啊》
回复
cooler 2006-05-05

我连PICTURE控件都放不到状态栏上面去,请问应该如何操作呢。
回复
cooler 2006-05-05
我搜索了以前的帖子:
community.csdn.net/Expert/topic/4175/4175181.xml?temp=.6768305
回复
相关推荐
发帖
VB基础类
创建于2007-09-28

7489

社区成员

VB 基础类
申请成为版主
帖子事件
创建了帖子
2006-05-05 04:58
社区公告
暂无公告