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

cooler 2006-05-05 04:58:03
我想在一个MDI窗体的状态拦上放置进度条。但是死活放不上去,鼠标一松开,就自己跑到窗体的最上面去了。我也参考了CSDN的以前的帖子,好像大家都说可以。
...全文
380 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
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

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧