Progressbar如果调整背景色:急求!

chenyabei 2003-10-18 08:58:12
第一次用Progressbar,找了半天,找不到调整该控件的背景色。请指教!
...全文
228 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodname008 2003-10-19
  • 打赏
  • 举报
回复
这样也行,不过没有用Picture自制自由,Picture可以做成过渡色,各种各样都可以做。

其实有时间的话,自己用Picture做一个强大的ProgressBar挺好的,用的时候拿来就能用。
chenyabei 2003-10-19
  • 打赏
  • 举报
回复
我自己找了一下,这样会更简单。
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 Sub Command1_Click()
ProgressBar1.Value = 55
SendMessage ProgressBar1.hwnd, &H2001, 0&, ByVal vbGreen
SendMessage ProgressBar1.hwnd, &H409, 0&, ByVal vbWhite
End Sub
goodname008 2003-10-18
  • 打赏
  • 举报
回复
' 抛砖引玉

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Load()
Timer1.Interval = 1
End Sub

Private Sub Timer1_Timer()
Static x As Long
Static direction As Boolean
If direction = False Then
Picture1.ForeColor = RGB((255 / Picture1.Width) * x, 0, 255)
x = x + 5
Picture1.Line (x, 0)-(x, Picture1.Height)
If x >= Picture1.Width Then direction = True
Else
Picture1.ForeColor = RGB((255 / Picture1.Width) * x, 255, 0)
x = x - 5
Picture1.Line (x, 0)-(x, Picture1.Height)
If x <= 0 Then direction = False
End If
End Sub
shenen 2003-10-18
  • 打赏
  • 举报
回复
自己动手做吧
goodname008 2003-10-18
  • 打赏
  • 举报
回复
如果开发时间允许的话可以用Label或Picture自己做一个ProgressBar。
chenyabei 2003-10-18
  • 打赏
  • 举报
回复
Progressbar如何调整背景色:急求!(第一次发贴,不好意思)

7,763

社区成员

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

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