Hi everybody, i have a ribbon control on a form... I create a ribbon group that contain two PopupMenuTools, three ButtonTools and one LabelTool. Those controls are grouped in three diferents buttonGroups (using InstanceProps.ButtonGroup) in the way PopupMenuTools-ButtonTool (for the first and second line) and LabelTool-ButtonTool for the third one. As you can see in the image the two first lines doesn't match the size of the third. I'd like to make all the lines the same size, is there anyway to do that ?? I've heard about creation filters but i don't know how to do that?
Any help ?
PD: Sorry for my english.
Hello Hristo, thank you very much. That's right. Now it's running ok.
Hello Sadiellp,
I ran your sample and I understood what you want. You can’t achieve this only with resizing the PopupMenu tool. First you should resize RibbonButtonGroupUIElement, where your tool is. To do this you could use code like this:
If TypeOf parent Is RibbonButtonGroupUIElement Then
parent.Rect = New Rectangle(parent.Rect.Location, New Size(375, parent.Rect.Size.Height))
End If
Probably you should resize and reposition elements in the RibbonButtonGroupUIElement which are LabelToolUIElement, ButtonToolUIElement and PopupToolUIElement to achieve what you are looking for.
Basically it is not recommended to do this with the Ribbon, but please let me know if you need any further assistant.
Hello Hristo, I'm sorry for taking so long to respond.Normally I use visual basic, so I made the conversion code you gave me to study it in depth. I send it to you in the attached file so you can see where I found the problem.As you can see, i have three lines (or levels). The first two lines contain the same controls, except that I changed the order of the last two controls for testing. The end result should be displayed as the first one line (label, label, PopupMenu, button)The purpose is that all lines got the same width as the last line. As you can see, change the width of the control works correctly but it overlaps with the following control (a buttontool) in the first line. And in the second line, being in last place, the control is not shown completly as it is cut by the group of options.I do not know if there is a simple solution to this problem.Thank you very much in advance.
Hello sadiellp,
Please look at the code in the Load event of the sample. Please note that there I am resizing two tools, Tools[1] which is PopUpMenuTool and Tools [2] is ButtonTool :
_toolsWidth.Add(ultraToolbarsManager1.Tools[2].Key, 150);
_toolsWidth.Add(ultraToolbarsManager1.Tools[1].Key, 100);
Please note that Tools[1] is PopUpMenuTool and Tools[2] is ButtonTool.
Let me know if you have any further questions on the attached sample.
Hello. I tested it.
It does the resize of the button, but what I need is to resize the PopupMenuTool and I haven't managed to make changes to the code to resize it.
Also, as jankol said, the button overlaps with the next control and looks ugly.
Thanks for reply, i will continue searching.