• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# QQControlState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# QRMethod类代码示例发布时间:2022-05-24
下一篇:
C# QQClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap