示例#1
0
        public void Draw(Graphics graphics)
        {
            ItemPrePaint?.Invoke(graphics, this);

            DrawIcon(graphics);

            switch (State)
            {
            case ItemControlState.MouseOn:
                DrawMouseOn(graphics);
                break;

            case ItemControlState.ClickedLeft:
            case ItemControlState.ClickedRight:
                DrawMouseClick(graphics);
                break;

            default:
                if (Selected)
                {
                    DrawMouseOn(graphics);
                }
                break;
            }

            DrawCaption(graphics);

            ItemPostPaint?.Invoke(graphics, this);
        }
示例#2
0
        public void Draw(Graphics graphics)
        {
            graphics.SmoothingMode = SmoothingMode.None;

            ItemPrePaint?.Invoke(graphics, this);

            DrawNormal(graphics);

            switch (State)
            {
            case ItemControlState.MouseOn:
            case ItemControlState.ClickedLeft:
            case ItemControlState.ClickedRight:
                DrawMouseOn(graphics);
                break;
            }

            if (Selected && State != ItemControlState.MouseOn)
            {
                DrawSelected(graphics);
            }

            ItemPostPaint?.Invoke(graphics, this);

            graphics.SmoothingMode = SmoothingMode.HighQuality;
        }
        public void Draw(Graphics graphics)
        {
            ItemPrePaint?.Invoke(graphics, this);

            if (Image != null)
            {
                graphics.DrawImageUnscaledAndClipped(Image, ClientRectangle);
            }

            ItemPostPaint?.Invoke(graphics, this);
        }
示例#4
0
        public void Draw(Graphics graphics)
        {
            if (Visible)
            {
                ItemPrePaint?.Invoke(graphics, this);

                DrawBody(graphics);
                DrawButtons(graphics);
                DrawSlider(graphics);

                ItemPostPaint?.Invoke(graphics, this);
            }
        }