第一次用Progressbar,找了半天,找不到调整该控件的背景色。请指教!

解决方案 »

  1.   

    Progressbar如何调整背景色:急求!(第一次发贴,不好意思)
      

  2.   

    如果开发时间允许的话可以用Label或Picture自己做一个ProgressBar。
      

  3.   

    ' 抛砖引玉Option Explicit
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Form_Load()
    Timer1.Interval = 1
    End SubPrivate 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
      

  4.   

    我自己找了一下,这样会更简单。
    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
      

  5.   

    这样也行,不过没有用Picture自制自由,Picture可以做成过渡色,各种各样都可以做。其实有时间的话,自己用Picture做一个强大的ProgressBar挺好的,用的时候拿来就能用。