Sure. You can use this procedure I wrote a while back:
Then you can call it like this: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
ShowProgressInStatus Progress1, Status1, 1
This will put ProgressBar into the first panel of the StatusBar.




Reply With Quote