USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Dicas

  Visual Basic    (Menu/Toobar/Coolbar)

Título da Dica:  Deixando a ToolBar (do VB5) no Estilo Flat
Postada em 14/8/2000 por Webmaster      Clique aqui para enviar email para o autor  webmaster@vbweb.com.br
'No módulo:
Private Declare Function FindWindowEx Lib "user32" _
        Alias "FindWindowExA" (ByVal hWnd1 As Long, _
        ByVal hWnd2 As Long, ByVal lpsz1 As String, _
        ByVal lpsz2 As String) As Long
Private Declare Function SendTBMessage Lib "user32" _
        Alias "SendMessageA" (ByVal hwnd As Long, _
        ByVal wMsg As Long, ByVal wParam As Integer, _
        ByVal lParam As Any) As Long

Private Const WM_USER As Long = &H400
Private Const TBSTYLE_FLAT As Long = &H800
Private Const TBSTYLE_TRANSPARENT As Long = &H8000
Private Const TB_SETSTYLE As Long = (WM_USER + 56)
Private Const TB_GETSTYLE As Long = (WM_USER + 57)

Public Sub MakeToolbarFlat(theToolbar As Control)
    Dim Res As Long
    Dim Style As Long
    Style = SendTBMessage(FindWindowEx(theToolbar.hwnd, _
            0&, "ToolbarWindow32", vbNullString), _
            TB_GETSTYLE, 0&, 0&)
    Style = Style Or TBSTYLE_FLAT Or TBSTYLE_TRANSPARENT
    Res = SendTBMessage(FindWindowEx(theToolbar.hwnd, 0&, _
          "ToolbarWindow32", vbNullString), TB_SETSTYLE, _
          0, Style)
    theToolbar.Refresh
End Sub

'P/ chamar, no evento Form_Load (por exemplo) coloque:
Private Sub Form_Load()
    Call MakeToolbarFlat(Toolbar1)
End Sub
 


CyberWEB Network Ltda.    © Copyright 2000-2024   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página