I'd like to create vertical toolbar just like the one from the windows common dialog for browsing files (see attached picture). But I was unable to find working example of it, not on this board nor on other internet resources. I need to create toolbar in code rather than from resource, and I tried a lot of stuff but I just couldn't make it work I experimented with a lot of styles such as CCS_VERT such as


invoke CreateWindowEx,WS_EX_NOPARENTNOTIFY,addr szToolBarClass,0,\
WS_VISIBLE or WS_CHILD or TBSTYLE_FLAT or CCS_VERT or CCS_LEFT or CBRS_LEFT,\
0,0,28,100hParent,0,hInstance,0

but still nothing...
Posted on 2004-06-11 17:09:32 by Mikky
Forgot to attach img :stupid:
Posted on 2004-06-11 17:14:23 by Mikky
I have a vertical toolbar example on my website, well, a vertical toolbar menu but essentially you just have to make the toolbar the child of a vertical rebar. Pretty easy to do, I use vertical toolbars in TBPaint and many of my apps. Are you sure that's a toolbar and not an ownerdrawn listbox (I don't have XP) ? Windows uses alot of listbox controls in those types of situations.
Posted on 2004-06-12 00:25:27 by donkey
Yes I am sure it's toolbar, spy++ told me that.
Thanks donkey I'll check out your site, I have never used rebar controls though.
Posted on 2004-06-12 05:37:35 by Mikky
Hi Donkey,

I managed to create vertical toolbar without rebar thanks to your example, however I couldn't set it's buttons to show text under bitmapl (as on upper image). I tried setting TBSTYLE_TRANSPARENT and TBSTYLE_FLAT (this styles will display text under image according to MSDN) but still no success.
Posted on 2004-06-13 11:42:25 by Mikky
Hi Mikky,

Here is a vertical toolbar with text under the item and flat.It does not use a rebar so you must call AutoSizeToolbar to set the size. Be sure not to use the autosize style with the toolbar.
Posted on 2004-06-13 12:30:36 by donkey
Hi donkey,
The example works well except one detail, did you notice that toolbar width is much bigger than you've set it? Check out the screenshot, I used spy++ to get toolbar properties and in the right bottom angle you can see the rectangle size. I came to this problem myself yesterday and I couldn't solve it. It makes practically useless any other control on the right side of the toolbar.
Posted on 2004-06-13 13:32:56 by Mikky
:grin:

Damn and after telling you to be sure not to set the autosize style I went ahead and left it turned on. I also moved the sizing call to the DlgProc. The fix is uploaded to the same post...
Posted on 2004-06-13 13:56:57 by donkey
After seeing this topic on toolbars on the forum, I decided to produce a help file for toolbar and rebar controls for ASM code. The development of the help file is taking longer than I expected so I am posting a help file that is still under development.

Although the help file explains how to do several things that appear as demonstrations on some webpages, this file will enable you to go beyond these simple demonstrations. For example, it shows how to implement hints when the mouse hovers over a toolbar button; it enables the user to customise a toolbar and restore the original toolbar using the customisation dialog box.

It also shows how to use a chevron when a rebar is constructed.

Two demonstration files are included - one for a toolbar control and one for a rebar control.

I am attaching a zip file that contains three other zip files:

1. ToolHelp.zip - the help file
2. Toolbar demo.zip - this shows how to produce a toolbar with tooltips and user customisation
3. Rebar demo.zip - a rebar demonstration that shows how to use a chevron.

I will update the help file when I have time....


Enjoy!!

I have updated the zip file attached to this message. The original toolbar demonstration contained some redundant code that may cause confusion.
Posted on 2004-07-10 15:26:27 by AsmCoder
The attached zip file contains:

(1) An updated version of my help file for the toolbar and rebar controls. I have added instructions for producing a dropdown button. A dropdown button is a button on the toolbar that produces a dropdown menu when the button is clicked.

(2) A program that demonstrates how to produce a dropdown button

AsmCoder
Posted on 2004-07-24 10:53:00 by AsmCoder