Hi, this is a simple question that I can't figure out. I created a new Windows Forms project, dropped an UltraToolbarsManager on the form (and added an UltraPanel set to dock fill per the pop-up warning), then added a ribbon tab and group. In the group, I added three ButtonTools. I want their border to be red. How do I do this?
In the designer Custom Property Pages for the UltraToolbarsManager, if I set the Appearance.BorderColor of the ribbon group to Red, it automatically turns it red right there while I'm watching. I have tried every Appearance I can think of for the button tool, but can't find one that turns the border red.
Any ideas?
Thanks,
J
Hello.
When a Button is drawn in a toolbar or ribbon what is actually being drawn is a ButtonToolUIElement. This class is a part of the Infragistics UIElement framework and all of the WinForms controls in the toolset use UIElements of various sorts. The ButtonToolUIElement doesn't draw a border by default. The appearance properties are on the ToolbarButton, however it's the ButtonToolUIElement that's actually resposible for drawing the rectangle and the other graphics that you see and this class doesn't draw any borders.
If you would like the ButtonTools to draw borders we can submit a feature request for you. In the meantime, the draw filter will work and will enable you to draw any border that you like. Please let me know if there is anything else I can do for you.
Sincerely,CharlieWindows Forms Development TeamMCTS
Thanks Dave, we started down the path of manually drawing the border, but we got pulled off that task when they decided to design around the problem.
Is there a reason I would have to manually draw the border around a ribbon tool while the other components like ribbon groups have the ability to access the border properties directly? There are four different border properties that I can see on the ribbon group appearance; those would all be useful for the buttons, too.
More to the point, if the ToolbarButton has those border settings in its appearances, why are they not honored? Seems like a bug. Is that the case, or am I missing something?
Hello Jamal,
You can get the border by using the following DrawFilter.
class DrawFilter :
IUIElementDrawFilter
{
#region
IUIElementDrawFilter Members
drawParams)
.BeforeDrawBorders)
)
;
rect = button.Rect;
drawParams.DrawBorders(
.Red, rect, rect);
}
.BeforeDrawBorders;
#endregion
Hello,
I have confirmed this behavior and logged it as a development issue.
Hi J,
I can see the issue that you are reporting. I will send an email to our Dev. Support team for further investigation and they will get in touch with you shortly.
ThanksPurnima