Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
How To Change Pin Button with a different image?
posted

Hi, My employer is very happy with the DockManager functionality but wants a simpler button for the pin/unpin.  Is there a way for me to replace the PIN image button with something that we have

<<  -- he wants this simple image instead instead of pin image

 

Hope to hear from you soon.

Parents
No Data
Reply
  • 115
    posted

    Oh thanks, I already found the answer in one of the existing post! :)

    If anyone is having a problem like this... this is what I did based on the other post

     

     public partial class TodayDockManager : UltraDockManager, Infragistics.Win.IUIElementDrawFilter
        {
            public TodayDockManager()
            {
                InitializeComponent();
                this.DrawFilter = this;
            }

            Pen borderPen = new Pen(Color.Black);


            #region IUIElementDrawFilter Members

            bool Infragistics.Win.IUIElementDrawFilter.DrawElement(Infragistics.Win.DrawPhase drawPhase,
                ref Infragistics.Win.UIElementDrawParams drawParams)
            {
                if (((PaneCaptionButtonUIElement)drawParams.Element.Parent).PaneButtonType == PaneButton.Pin)
                {
                    Rectangle elementRect = drawParams.Element.Rect;
                    int rightX = elementRect.Right;
                    int topY = elementRect.Top;

                    if (((Infragistics.Win.UltraWinDock.DockableWindow)drawParams.Element.Parent.Control).Pane.DockAreaPane.DockedLocation == DockedLocation.DockedLeft)
                    //    if (((Infragistics.Win.UltraWinDock.DockableWindow)drawParams.Element.Parent.Control).Pane.Key.Equals("filter"))
                    {
                        //right arrow top
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 1, topY + 1), new Point(rightX, topY + 1) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX, topY + 2), new Point(rightX - 1, topY + 2), new Point(rightX - 2, topY + 2) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 1, topY + 3), new Point(rightX - 2, topY + 3), new Point(rightX - 3, topY + 3) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 2, topY + 4), new Point(rightX - 4, topY + 4), new Point(rightX - 3, topY + 4) });

                        //right arrow bottom
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 1, topY + 5), new Point(rightX - 2, topY + 5), new Point(rightX - 3, topY + 5) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX, topY + 6), new Point(rightX - 1, topY + 6), new Point(rightX - 2, topY + 6) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 1, topY + 7), new Point(rightX, topY + 7) });

                        //left arrow top
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 5, topY + 1), new Point(rightX - 6, topY + 1) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 5, topY + 2), new Point(rightX - 6, topY + 2), new Point(rightX - 7, topY + 2) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 6, topY + 3), new Point(rightX - 7, topY + 3), new Point(rightX - 8, topY + 3) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 7, topY + 4), new Point(rightX - 8, topY + 4), new Point(rightX - 9, topY + 4) });

                        //left arrow bottom
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 6, topY + 5), new Point(rightX - 7, topY + 5), new Point(rightX - 8, topY + 5) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 5, topY + 6), new Point(rightX - 6, topY + 6), new Point(rightX - 7, topY + 6) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 5, topY + 7), new Point(rightX - 6, topY + 7) });

                    }
                    if (((Infragistics.Win.UltraWinDock.DockableWindow)drawParams.Element.Parent.Control).Pane.DockAreaPane.DockedLocation == DockedLocation.DockedTop)
                    {
                        //top arrow
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-1, topY), new Point(rightX-1, topY+1) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-2, topY), new Point(rightX-2, topY+1), new Point(rightX-2, topY+2) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-3, topY+1), new Point(rightX-3, topY+2), new Point(rightX-3, topY+3) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-4, topY+2), new Point(rightX-4, topY+3), new Point(rightX-4, topY+4) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-5, topY+1), new Point(rightX-5, topY+2), new Point(rightX-5, topY+3) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-6, topY), new Point(rightX-6, topY+1), new Point(rightX-6, topY+2) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX-7, topY), new Point(rightX-7, topY+1)});

                        //bottom arrow
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 1, topY+5), new Point(rightX - 1, topY+6) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 2, topY+5), new Point(rightX - 2, topY+6), new Point(rightX-2, topY+7) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 3, topY+6), new Point(rightX - 3, topY+7), new Point(rightX - 3, topY+8) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 4, topY+7), new Point(rightX - 4, topY+8), new Point(rightX - 4, topY+9) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 5, topY+8), new Point(rightX - 5, topY+7), new Point(rightX - 5, topY+6) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 6, topY+5), new Point(rightX - 6, topY+6), new Point(rightX - 6, topY+7) });
                        drawParams.Graphics.DrawPolygon(this.borderPen, new Point[] { new Point(rightX - 7, topY+5), new Point(rightX - 7, topY+6) });

                    }
                    return true;
                }
                else
                {
                    return false;
                }          
            }

            Infragistics.Win.DrawPhase Infragistics.Win.IUIElementDrawFilter.GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)
            {
                if (drawParams.Element is CaptionButtonImageUIElement)
                    return Infragistics.Win.DrawPhase.BeforeDrawImage;
                else
                    return Infragistics.Win.DrawPhase.None;

            }

     

Children