本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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);
}
示例5: OnMouseEnter
protected override void OnMouseEnter(EventArgs e)
{
_state = QQControlState.Highlight;
base.OnMouseEnter(e);
}
示例6: OnMouseDown
protected override void OnMouseDown(MouseEventArgs mevent)
{
if (mevent.Button == MouseButtons.Left)
{
_state = QQControlState.Down;
}
base.OnMouseDown(mevent);
}
示例7: OnLostFocus
protected override void OnLostFocus(EventArgs e)
{
_state = QQControlState.Normal;
base.OnLostFocus(e);
}
示例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));
}
示例9: OnMouseLeave
protected override void OnMouseLeave(EventArgs e)
{
_state = QQControlState.Normal;
base.OnMouseLeave(e);
}
示例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));
}
}
示例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);
}
示例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);
}
示例13: OnMouseDown
protected override void OnMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
_state = QQControlState.Down;
Invalidate();
base.OnMouseDown(e);
}
示例14: OnLostFocus
protected override void OnLostFocus(EventArgs e)
{
_state = QQControlState.Normal;
Invalidate();
_holdingSpace = false;
base.OnLostFocus(e);
}