Question

$Hello_all,

I'm adding functionality to a VB6 application (yes, I know, an amazing task :P) and I need to drop an ActiveX control (it looks like a button but does more things) into a comctlib (Microsoft Common Controls) Toolbar.

Is this possible at all? I don't mind using the Winapi, interop or whatever is needed as I really need this feature. If this is not possible with the Comctlib control is there another toolbar control for VB6 where I can drop other ActiveX controls?

Thanks in advance for helping me with this outdated technology.

Was it helpful?

Solution

In addition to its intrinsic Buttons collection, the toolbar acts as a general container. So, to position any (non-lightweight*) control/s you want between existing buttons, insert a new button and set its Style property to PlaceHolder – that creates a blank area in the desired position – and place your control/s there.

Of course you will have to manually reposition any such control/s if you dynamically show/hide/add/remove buttons at runtime.

* To display lightweight controls, you could place them inside any other container control – e.g. a borderless PictureBox – first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top