Buongiorno a tutti...
Problema (forse stupido..)
Come faccio ad inserire una ProgressBar in una StatusBar del mio form principale??
Grazie della collaborazione.
Buongiorno a tutti...
Problema (forse stupido..)
Come faccio ad inserire una ProgressBar in una StatusBar del mio form principale??
Grazie della collaborazione.
Angelo![]()
![]()
Risolto:
'Module Declares
Public Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Public Declare Function SendMessageAny Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal msg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Const WM_USER = &H400
Public Const SB_GETRECT = (WM_USER + 10)
'_________________________________________________ ________
Private Sub ShowProgress(Mode As Boolean)
Dim rc As RECT
StatusBar1.Panels("keyProgress").Visible = Mode
If Mode Then
'2 => Panel index (0 based)
SendMessageAny StatusBar1.hwnd, SB_GETRECT, 2, rc
With rc
.Top = .Top * Screen.TwipsPerPixelY
.Left = .Left * Screen.TwipsPerPixelX
.Bottom = .Bottom * Screen.TwipsPerPixelY - .Top
.Right = .Right * Screen.TwipsPerPixelX - .Left
End With
With ProgressBar1
SetParent .hwnd, StatusBar1.hwnd
.Move rc.Left, rc.Top, rc.Right, rc.Bottom
.Visible = True
.Value = 0
End With
Else
SetParent ProgressBar1.hwnd, Me.hwnd
ProgressBar1.Visible = False
End If
End Sub
Angelo![]()
![]()