It is working just fine. In order for you to see the Progress, you will have to change it's value. Here is an example. Drop a Timer control on the form and use this code:
Code:Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As Any) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Const WM_USER As Long = &H400 Private Const SB_GETRECT As Long = (WM_USER + 10) Public Sub ShowProgressInStatus(pProgress As ProgressBar, pStatus As StatusBar, pPanelIndex As Integer) Dim tRC As RECT pProgress.Appearance = ccFlat 'Get the size of the given panel SendMessage StatusBar1.hwnd, SB_GETRECT, pPanelIndex - 1, tRC 'Convert to Twips With tRC .Top = (.Top * Screen.TwipsPerPixelY) + 20 .Left = (.Left * Screen.TwipsPerPixelX) + 20 .Bottom = (.Bottom * Screen.TwipsPerPixelY) - .Top .Right = (.Right * Screen.TwipsPerPixelX) - .Left - 20 End With 'Reparent the ProgressBar to the statusbar With ProgressBar1 SetParent .hwnd, StatusBar1.hwnd .Move tRC.Left, tRC.Top, tRC.Right, tRC.Bottom .Visible = True .Value = 0 End With End Sub Private Sub Form_Load() Timer1.Interval = 100 ShowProgressInStatus ProgressBar1, StatusBar1, 1 End Sub Private Sub Timer1_Timer() With ProgressBar1 If .Value = .Max Then .Value = .Min Else .Value = .Value + 1 End If End With End Sub




Reply With Quote