web development India freelance website designer
***************************************************************
* Go to Dragon's VB Code Corner for more useful sourcecode: *
* http://personal.inet.fi/cool/dragon/vb/ *
***************************************************************

This code shows how to change a VB toolbar control so that it looks like the IE style toolbar, with 'flat' buttons.
Call the function like this:

Call MakeToolbarFlat(myToolbar)

myToolbar is, of course, the name of your toolbar control.

Paste the following code into a module:


Public 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
Public 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

Public Const WM_USER = &H400
Public Const TBSTYLE_FLAT = &H800
Public Const TBSTYLE_TRANSPARENT = &H8000
Public Const TB_SETSTYLE = (WM_USER + 56)
Public Const TB_GETSTYLE = (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

Make flat ToolBar

1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design