Option Explicit
Private Const WS_EX_TRANSPARENT = &H20&
Private Const GWL_EXSTYLE = (-20)
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Sub Command1_Click()
MakeWindowedControlTransparent ProgressBar1
End Sub
Private Function MakeWindowedControlTransparent(ctlControl As Control) As Long
Dim result As Long
ctlControl.Visible = False
result = SetWindowLong(ctlControl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT)
ctlControl.Visible = True ' Use the visible property as a quick VB way of forcing a repaint with the new style
MakeWindowedControlTransparent = result
End Function