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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-13
  • 2022-12-23
  • 2021-04-06
  • 2021-12-21
  • 2021-10-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案