当前位置: 首页>>代码示例>>C#>>正文


C# QQControlState类代码示例

本文整理汇总了C#中QQControlState的典型用法代码示例。如果您正苦于以下问题:C# QQControlState类的具体用法?C# QQControlState怎么用?C# QQControlState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QQControlState类属于命名空间,在下文中一共展示了QQControlState类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnEnabledChanged

 protected override void OnEnabledChanged(EventArgs e)
 {
     if (Enabled)
     {
         _state = QQControlState.Normal;
     }
     else
     {
         _state = QQControlState.Disabled;
     }
     base.OnEnabledChanged(e);
 }
开发者ID:KeithLee208,项目名称:ISoft_Source,代码行数:12,代码来源:QQRadioButton.cs

示例2: OnPaint

        protected override void OnPaint(PaintEventArgs pevent)
        {
            base.OnPaint(pevent);
            Graphics g = pevent.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.InterpolationMode = InterpolationMode.HighQualityBilinear;

            Rectangle imageRect, textRect;
            CalculateRect(out imageRect, out textRect);

            if (!Enabled)
            {
                _state = QQControlState.Disabled;
            }
            switch (_state)
            {
                case QQControlState.Normal:

                    RenderHelper.DrawImageWithNineRect(
                        g, _normalImg,
                        ClientRectangle,
                        new Rectangle(0, 0, _normalImg.Width, _normalImg.Height));
                    break;
                case QQControlState.Highlight:

                    RenderHelper.DrawImageWithNineRect(
                        g, _highlightImg,
                        ClientRectangle,
                        new Rectangle(0, 0, _highlightImg.Width, _highlightImg.Height));
                    break;
                case QQControlState.Focus:

                    RenderHelper.DrawImageWithNineRect(
                        g, _focusImg,
                        ClientRectangle,
                        new Rectangle(0, 0, _focusImg.Width, _focusImg.Height));
                    break;
                case QQControlState.Down:
                    RenderHelper.DrawImageWithNineRect(
                       g, _downImg,
                       ClientRectangle,
                       new Rectangle(0, 0, _downImg.Width, _downImg.Height));
                    break;
                case QQControlState.Disabled:
                    DrawDisabledButton(g);
                    break;
                default:
                    break;
            }

            if (Image != null)
            {
                g.DrawImage(Image, imageRect, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel);
            }

            Color textColor = Enabled ? ForeColor : SystemColors.GrayText;
            TextRenderer.DrawText(
                  g,
                  Text,
                  Font,
                  textRect,
                  textColor,
                  GetTextFormatFlags(TextAlign, RightToLeft == RightToLeft.Yes));
        }
开发者ID:hdkn235,项目名称:MyControls,代码行数:64,代码来源:QQButton.cs

示例3: OnMouseUp

 protected override void OnMouseUp(MouseEventArgs mevent)
 {
     if (mevent.Button == MouseButtons.Left)
     {
         if (ClientRectangle.Contains(mevent.Location))
         {
             _state = QQControlState.Highlight;
         }
         else
         {
             _state = QQControlState.Focus;
         }
     }
     base.OnMouseUp(mevent);
 }
开发者ID:hdkn235,项目名称:MyControls,代码行数:15,代码来源:QQButton.cs

示例4: OnMouseLeave

 protected override void OnMouseLeave(EventArgs e)
 {
     if (_state == QQControlState.Highlight && Focused)
     {
         _state = QQControlState.Focus;
     }
     else if (_state == QQControlState.Focus)
     {
         _state = QQControlState.Focus;
     }
     else
     {
         _state = QQControlState.Normal;
     }
     base.OnMouseLeave(e);
 }
开发者ID:hdkn235,项目名称:MyControls,代码行数:16,代码来源:QQButton.cs

示例5: OnMouseEnter

 protected override void OnMouseEnter(EventArgs e)
 {
     _state = QQControlState.Highlight;
     base.OnMouseEnter(e);
 }
开发者ID:hdkn235,项目名称:MyControls,代码行数:5,代码来源:QQButton.cs

示例6: OnMouseDown

 protected override void OnMouseDown(MouseEventArgs mevent)
 {
     if (mevent.Button == MouseButtons.Left)
     {
         _state = QQControlState.Down;
     }
     base.OnMouseDown(mevent);
 }
开发者ID:hdkn235,项目名称:MyControls,代码行数:8,代码来源:QQButton.cs

示例7: OnLostFocus

 protected override void OnLostFocus(EventArgs e)
 {
     _state = QQControlState.Normal;
     base.OnLostFocus(e);
 }
开发者ID:hdkn235,项目名称:MyControls,代码行数:5,代码来源:QQButton.cs

示例8: OnPaint

        protected override void OnPaint(PaintEventArgs pevent)
        {
            base.OnPaint(pevent);
            base.OnPaintBackground(pevent);

            Graphics g = pevent.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;

            Rectangle checkRect, textRect;
            CalculateRect(out checkRect, out textRect);

            if (Enabled == false)
            {
                _state = QQControlState.Disabled;
            }

            switch (_state)
            {
                case QQControlState.Highlight:
                case QQControlState.Down:
                    DrawHighLightCheckRect(g, checkRect);
                    break;
                case QQControlState.Disabled:
                    DrawDisabledCheckRect(g, checkRect);
                    break;
                default:
                    DrawNormalCheckRect(g, checkRect);
                    break;
            }

            Color textColor = (Enabled == true) ? ForeColor : SystemColors.GrayText;
            TextRenderer.DrawText(
                g,
                Text,
                Font,
                textRect,
                textColor,
                GetTextFormatFlags(TextAlign, RightToLeft == RightToLeft.Yes));
        }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:40,代码来源:QQCheckBox.cs

示例9: OnMouseLeave

 protected override void OnMouseLeave(EventArgs e)
 {
     _state = QQControlState.Normal;
     base.OnMouseLeave(e);
 }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:5,代码来源:QQCheckBox.cs

示例10: WmPaint

        private void WmPaint(ref Message m)
        {
            Graphics g = Graphics.FromHwnd(base.Handle);
            g.SmoothingMode = SmoothingMode.AntiAlias;

            if (!Enabled)
            {
                _state = QQControlState.Disabled;
            }

            switch (_state)
            {
                case QQControlState.Normal:
                    DrawNormalTextBox(g);
                    break;
                case QQControlState.Highlight:
                    DrawHighLightTextBox(g);
                    break;
                case QQControlState.Focus:
                    DrawFocusTextBox(g);
                    break;
                case QQControlState.Disabled:
                    DrawDisabledTextBox(g);
                    break;
                default:
                    break;
            }

            if (Text.Length == 0 && !string.IsNullOrEmpty(EmptyTextTip) && !Focused)
            {
                TextRenderer.DrawText(g, EmptyTextTip, Font, ClientRectangle, EmptyTextTipColor, GetTextFormatFlags(TextAlign, RightToLeft == RightToLeft.Yes));
            }
        }
开发者ID:yugsh,项目名称:PianoGame,代码行数:33,代码来源:QQTextBox.cs

示例11: OnMouseUp

 protected override void OnMouseUp(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (ClientRectangle.Contains(e.Location))
             _state = QQControlState.Highlight;
         else
             _state = QQControlState.Normal;
     }
     Invalidate();
     base.OnMouseUp(e);
 }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:12,代码来源:QQGlassButton.cs

示例12: OnMouseEnter

        protected override void OnMouseEnter(EventArgs e)
        {
            //show tool tip
            if (ToolTipText != string.Empty)
            {
                HideToolTip();
                ShowTooTip(ToolTipText);
            }

            _state = QQControlState.Highlight;
            Invalidate();
            base.OnMouseEnter(e);
        }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:13,代码来源:QQGlassButton.cs

示例13: OnMouseDown

 protected override void OnMouseDown(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
         _state = QQControlState.Down;
     Invalidate();
     base.OnMouseDown(e);
 }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:7,代码来源:QQGlassButton.cs

示例14: OnLostFocus

 protected override void OnLostFocus(EventArgs e)
 {
     _state = QQControlState.Normal;
     Invalidate();
     _holdingSpace = false;
     base.OnLostFocus(e);
 }
开发者ID:wljcom,项目名称:marukotoolbox,代码行数:7,代码来源:QQGlassButton.cs


注:本文中的QQControlState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。