예제 #1
0
 public OurCloseButton(OurForm ourForm)
 {
     this._ourForm = ourForm;
     this.Normal = new OurCloseButtonNormal(ourForm);
     this.Hovered = new OurCloseButtonHovered(ourForm);
     this.Clicked = new OurCloseButtonClicked(ourForm);
     this.Disabled = new OurCloseButtonDisabled(ourForm);
 }
예제 #2
0
        private void PaintButton(IOurFormButtonDesigner buttonDesigner,
                                 Graphics g,
                                 ref Pen p,
                                 ref SolidBrush sB,
                                 Rectangle r)
        {
            if (buttonDesigner.DrawBox)
            {
                sB.Color = buttonDesigner.BoxColor;
                g.FillRectangle(sB, r.X + 1, r.Y + 1, r.Width - 2, r.Height - 2);
            }

            if (buttonDesigner.DrawBoxBorder)
            {
                p.Color = buttonDesigner.BoxBorderColor;
                g.FillRectangle(sB, r.X + 1, r.Y + 1, r.Width - 2, r.Height - 2);
            }

            if (buttonDesigner.DrawCircle)
            {
                sB.Color = buttonDesigner.CircleColor;
                g.FillEllipse(sB, r.X + 7, r.Y + 7, r.Width - 14, r.Height - 14);
            }

            if (!buttonDesigner.DrawCircleBorder) { return; }

            p.Color = buttonDesigner.CircleBorderColor;
            g.DrawEllipse(p, r.X + 7, r.Y + 7, r.Width - 14, r.Height - 14);
        }