Visual Basic > Windows and Controls
Make the toolbar flat like in Office etc
Make the toolbar flat like in Office etc 'make a new project 'with a toolbar on it (name = toolbar1) 'insert the next code 'press F5 Private Declare Function SendMessage Lib "user32" alias "SendMessageA" (ByVal HWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long 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 Const WM_USER = &H400 Const TB_SETSTYLE = WM_USER + 56 Const TB_GETSTYLE = WM_USER + 57 Const TBSTYLE_FLAT = &H800 Private sub SetToolBarFlat(tlbTemp As Toolbar) Dim lngStyle As Long Dim lngResult As Long Dim lngHWND As Long lngHWND = FindWindowEx(tlbTemp.HWnd, 0&, "ToolbarWindow32", vbNullString) lngStyle = SendMessage(lngHWND, TB_GETSTYLE, &O0, &O0) lngStyle = lngStyle Or TBSTYLE_FLAT lngResult = SendMessage(lngHWND, TB_SETSTYLE, 0, lngStyle) tlbTemp.Refresh End Sub Private sub Form_Load Call SetToolbarFlat(Toolbar1) End Sub Return
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows