Custom control on toolbar

Bars for Windows Forms Forum

Posted 13 years ago by Mario Giacomino
Avatar
Hi, I would like to put a custom control onto one of the toolbars. Is this possible?
Thanks,
Mario

Comments (11)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes you can, it's a bit tricky though. Both our combobox and textbox commands/links inherit BarCustomControlCommand and BarCustomControlLink to achieve embedding a textbox in the bar command. You'd have to create your own classes that inherit BarCustomControlCommand and BarCustomControlLink. But by doing that you should be able to embed your control.


Actipro Software Support

Posted 13 years ago by Mario Giacomino
Avatar
Okay, cool. I saw the post in May regarding this right after I posted the question. Is it possible for you to send me some example code on how to do this? I am using C# with the Actipro 2.0 UIStudio Suite.
Thanks, Mario
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sure I'll send over something now.


Actipro Software Support

Posted 13 years ago by Michael Janulaitis - CEO, Corner Bowl Software Corporation
Avatar
You you please send me the snippet as well. Thanks
Posted 10 years ago by Lemma
Avatar
I'm also trying to solve the same issue and would be interested in the code you sent before.

Thank you
Posted 9 years ago by Stepan
Avatar
Please, send to me either.
Thanks!
Posted 9 years ago by Stepan
Avatar
Thanks for the code!
But is there any way to have BarCustomControlCommand/BarCustomControlLink inherited controls (BarDateTimePicker in sample code) available in design time?
Thanks.
Regards
Posted 9 years ago by Lemma
Avatar
Use attributes

[ToolboxItemAttribute(true)]
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
public class LabeledAttrFilterComboBoxToolStripItem : ToolStripControlHostBase
Posted 9 years ago by Stepan
Avatar
Those attributes worked for me previously to have custom controls (inherited from ToolStripControlHostBase) available for standard ToolStrip control.
But now we are talking about BarCustomControlCommand/BarCustomControlLink inherited controls availability for Actipro BarManager design time customization.
And of course those attributes wouldn't help me.
Suppose we should use alike attributes special for BarManager designer (if supported).
But I had briefly look on "BarCustomizeNewBarCommandForm.cs" code (our company have Enterprise license), and it looks like we we can't do it for now.

Did i missed something? Please advise.
Regards.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Stepan,

Unfortunately it won't show up in design time out of the box as an available option to be added. If you have the source you could integrate your customer control into that designer functionality though.


Actipro Software Support

Posted 9 years ago by Stepan
Avatar
Yeah, I already get this, thanks.
For now I just replacing any desired command declaration by custom one in designer generated code.
But it would be nice to have a similar behavior as described above for ToolStripControlHostBase+ToolStrip.
The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.