Пример #1
0
        protected override void OnDraw(GraphicsCache graphics, RectangleF area)
        {
            if (Application.RenderWithVisualStyles && VisualStyleRenderer.IsElementDefined(GetBackgroundElement()))
            {
                GetRenderer(GetBackgroundElement()).DrawBackground(graphics.Graphics, Rectangle.Round(area));

                if (Style == ButtonStyle.Focus)
                {
                    using (MeasureHelper measure = new MeasureHelper(graphics)) {
                        ControlPaint.DrawFocusRectangle(graphics.Graphics, Rectangle.Round(area));
                    }
                }
            }
            else
            {
                mStandardButton.Draw(graphics, area);
            }
        }
Пример #2
0
        protected override void OnDraw(GraphicsCache graphics, RectangleF area)
        {
            // [email protected] : This is added to keep the width and height of the
            // dropdown button same in the view
            ProportionateSize(ref area);
            if (Application.RenderWithVisualStyles && VisualStyleRenderer.IsElementDefined(GetBackgroundElement()))
            {
                GetRenderer(GetBackgroundElement()).DrawBackground(graphics.Graphics, Rectangle.Round(area));

                if (Style == ButtonStyle.Focus)
                {
                    using (MeasureHelper measure = new MeasureHelper(graphics))
                    {
                        ControlPaint.DrawFocusRectangle(graphics.Graphics, Rectangle.Round(area));
                    }
                }
            }
            else
            {
                mStandardButton.Draw(graphics, area);
            }
        }