|
Button Size and Position
A toolbar keeps track of its buttons by assigning each button a position
index. The index is zero based; that is, the leftmost button has an index of zero,
the next button to the right has an index of one, and so on. An application must
specify the index of a button when sending messages to retrieve information
about the button or set the button's attributes.
A toolbar updates the position indexes as buttons are inserted and removed. An
application can retrieve the current position index of a button by using the TB_COMMANDTOINDEX message. The message specifies the command identifier of a button, and the
toolbar window uses the identifier to locate the button and return its position
index.
All buttons in a toolbar are the same size. The CreateToolbarEx function requires you to set the initial size of the buttons when you create
the toolbar. When you use the CreateWindowEx function to create a toolbar, the initial size is set to the default
dimensions of 24 by 22 pixels. You can use the TB_SETBUTTONSIZE message to change the button size, but you must do so before adding any
buttons to the toolbar. The TB_GETITEMRECT message retrieves the current dimensions of the buttons.
A toolbar automatically sets the width of its buttons when you add a string to
the toolbar that is longer than any current toolbar string. The width is set
to accommodate the longest string in the toolbar.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|