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); } }
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); } }