|  |   |   | 
		
			| 
				
					| 
 |  
					| 
 |   Dicas |  
					| 
 | Visual Basic    (Menu/Toobar/Coolbar) |  |  
 
		
		
			| 
				
					|  | Título da Dica:  Colocar Barra de Progresso no Toolbar |  |  |  
			|  |  
			| 
				
					
						| Postada em 29/6/2002 por Leonardo  leonardohorta@bol.com.br Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
 Private Declare Function SendMessageAny 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)
 
 dim i as string
 
 Private Sub ShowProgressInStatusBar(ByVal bShowProgressBar As Boolean)
 Dim tRC As RECT
 If bShowProgressBar Then
 
 SendMessageAny StatusBar1.hwnd, SB_GETRECT, 1, tRC
 
 With tRC
 .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 tRC.Left, tRC.Top, tRC.Right, tRC.Bottom
 .Visible = True
 .Value = 0
 End With
 Else
 
 SetParent ProgressBar1.hwnd, Me.hwnd
 ProgressBar1.Visible = False
 End If
 End Sub
 Private Sub form_load()
 Call ShowProgressInStatusBar(True)
 
 For i = 1 To ProgressBar1.Max
 ProgressBar1.Value = i
 Next i
 End Sub
 |  
						|   |  |  
 | 
 
 |