yzx99

导航

 

VB6,新建一个工程,在界面中放置一个进度条控件,输入如下代码:
Option Explicit

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const PBM_SETBARCOLOR = &H409
Private Const PBM_SETBKCOLOR = &H2001

Private Sub Form_Load()
  PostMessage ProgressBar1.hwnd, PBM_SETBARCOLOR, 0, vbRed
  PostMessage ProgressBar1.hwnd, PBM_SETBKCOLOR, 0, vbGreen
  ProgressBar1.Value = 30
End Sub

 

posted on 2009-05-09 21:44  yzx99  阅读(917)  评论(0编辑  收藏  举报