Hi all,
is it possible to align ribbon tools to each other?
I would like to align the start of a textbox in a textboxtool with caption to the start of the combobox in a comboboxtool with caption (see screenshot).
How can I do this?
Thanks
Michael
Hello Michael,
Yes, you can align the tools. What you need to do is set the Width of either TextBoxTool or ComboBoxTool. Please follow this link to our online documentation where you may find additional information about Width property.
Please let me know if you have any further questions.
Hi Milko,
thanks for your reply, but that is not what I'm looking for.
I know that I can somehow align it via width, btw. that is just fiddeling. Using width means that it is fixed in conjuntion with the text length. But the text may change.
In my particular case it changes because of diffrent languages of the application.
I just want the tools to be aligned with their real tools no matter how long the label text may be.
Regards
Hi Michael,
In this case one possible solution could be to implement IUIElementCreationFilter. This interface allows custom position or creation of the UIElements. So what you need to do in your creation filter is find the textbox/ combobox UIElements and manipulate their sizes and locations. In the attached sample project I have implement one simple creation filter to show you how you can achieve this.
Please check my sample and let me know if you have any additional questions.
I already tried that way and it will work fine. The problem with that solution is that I do not only want to align two dedicated controls. I want to align the whole ribbon in that way. That would mean that I would need to know which control needs to align to which other control and in which way in code. That will not work.
I need to do that at design time. I guess I found a workaround using hidden seperators and seperate such controls into a label and a control (textbox, combo, etc) without setting the caption. I can then align them by setting IsFirstInGroup and Group numbers.
I am glad to hear that you have resolved your issue.
Please let me know if you have any additional questions about this matter.