本人需要使用进度条,又需要事情按Value值变色。不知怎样作可以改变其前景色和背景色。
谢谢。

解决方案 »

  1.   

    http://www.hky5.com/wswy/all/vbcode/contor/Gradient%20ProgressBar%20-%20Graphical!.zip
    上面是个ACTIVEX 控件源码,你可以下来研究以下。
      

  2.   

    Public Sub ChangPBColor(ByVal ipProgBarHwnd As Long, Optional ByVal ipfColor As Long, Optional ByVal ipbColor As Long)
        If ipfColor <> 0 Then Call SendMessage(ipProgBarHwnd, PBM_SETBARCOLOR, 0, ByVal ipfColor)
        If ipbColor <> 0 Then Call SendMessage(ipProgBarHwnd, PBM_SETBKCOLOR, 0, ByVal ipbColor)End Sub
      

  3.   

    MSDN中关于这个消息的说明。PBM_SETBARCOLORPBM_SETBARCOLOR
        wParam = 0;
        lParam = (LPARAM)(COLORREF)clrBar;Sets the color of the progress indicator bar in the progress bar control. Returns the previous progress indicator bar color, or CLR_DEFAULT if the progress indicator bar color is the default color. 
    clrBar 
    COLORREF value that specifies the new progress indicator bar color. Specify the CLR_DEFAULT value to cause the progress bar to use its default progress indicator bar color. 
      

  4.   

    所有和Progress Bar有关的消息。Progress Bar Control Messages
    This section includes information about the messages used with progress bar controls. PBM_DELTAPOS
    PBM_GETPOS
    PBM_GETRANGE
    PBM_SETBARCOLOR
    PBM_SETBKCOLOR
    PBM_SETPOS
    PBM_SETRANGE
    PBM_SETRANGE32
    PBM_SETSTEP
    PBM_STEPIT
      

  5.   

    我就是在MSDN中找不到那几个PBM_……的值是多少。用搜索都搜索不到。其他几位老哥的方法确实很有心意,值得一试!
      

  6.   

    PBM_开头的值要在API Viewer中查看的,可能VB自带的有点老了,我接触到的最好的是APIViewer 2003,第三方做的,到Google查一下吧。在MSDN中只能PBM_打头的常数是干什么用的,怎么用。
      

  7.   

    APIViewer 2003找了半天,下不了。给个地址吧。
      

  8.   

    我用picture控件自己做了一个
    就是根据时间改变height或width属性
    就可以了