Hi
I would like to put a border at the top of an ultrapanel. Is it possible to have the border (a solid line) at just the top of the ultrapanel?
Thanks
Paul
Hello Paul,
My suggestion for achieving your requirement is using DrawFilter. In the DrawFilter class implementation you can create a pen with color and width as you need and draw line only on top of the Panel.
public class DrawFilter : IUIElementDrawFilter { Pen borderPen = new Pen(Color.DarkGoldenrod, 15); public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { // If the element being drawn is a ControlUIElementBase // we're interested in drawing its borders only. Rectangle elementRect = drawParams.Element.Rect; drawParams.Graphics.DrawLine(this.borderPen, elementRect.Location, new Point(elementRect.Right, elementRect.Top)); // Return true to prevent the element from drawing // its borders normally. return true; } public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is ControlUIElementBase) return DrawPhase.BeforeDrawElement; return DrawPhase.None; } }
I have attached a sample application that uses this approach. Please test it on your side and let me know if I may be of any further assistance.
Sincerely, Teodosia Hristodorova Associate Software Developer
0602.Top_Border_UltraPanel.zip
Perfect, thanks.
I am glad that you find my suggestion helpful.Thank you for using Infragistics components.
Regards,Teodosia HristodorovaAssociate Software Developer