devxlogo

How to Use the CreateToolbarEx Function

How to Use the CreateToolbarEx Function

Question:
How do you use the CreateToolbarEx function? I want to use it to create dockable tool bars.

Answer:
With CreateToolBarEx, you’re walking into real low-level stuff that willrequire that you create an array of TBButtons, add bitmap images to them,and create a window proc command handler. It’s a lot of work to get thisworking properly.

Let me ask you this: Is your toolbar application-specific, or are you tryingto create some type of global toolbar? If it’s application specific, you canconstruct a form, override its CreateParams method and give it a style ofWS_CHILD. You can also remove its border and position it so that it’s”docked” on the side of the parent form that you choose.

As far as creating a child form is concerned, refer to an article I wrote on creating a child form. It’s an in-depthdiscussion of the various things you need to consider for constructing thistype of object in Delphi.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist