您的位置:首页 > 编程语言 > C#

C#仿QQ皮肤-DateTimePicker 控件实现

2010-07-15 13:13 681 查看
原文:http://www.sufeinet.com/thread-2094-1-1.html

大家还是先来看看效果吧

代码

public void ResetBitmap()
{
this.NormalImage = Shared.NomalDrawButton;
this.MouseDownImage = Shared.MouseDownDrawButton;
this.MouseMoveImage = Shared.MouseMoveDrawButton;
}

protected override void OnValueChanged(EventArgs eventargs)
{
base.OnValueChanged(eventargs);
this.Invalidate();
} private void OverrideDropDown(Graphics g)
{
//if (!this.ShowUpDown)
//{
Rectangle rect = new Rectangle(this.Width - DropDownButtonWidth, 0, DropDownButtonWidth, this.Height);
//ControlPaint.DrawComboButton(g, rect, ButtonState.Flat);
//}
g.FillRectangle(new SolidBrush(Color.White), rect);

if (this.Enabled)
{
if (_mouseEnter)
{
g.DrawImage(this.MouseMoveImage, new Rectangle(this.Width - 20, 3, 16, 16));
}
else
{
g.DrawImage(this.NormalImage, new Rectangle(this.Width - 20, 3, 16, 16));
}
}
else
{
g.DrawImage(Shared.NotEnableDrawButton, new Rectangle(this.Width - 20, 3, 16, 16));
}
}

2.时间和日期绘制

..................

3.几个常用事件的处理

..................

下面是程序所有代码

原文:http://www.sufeinet.com/thread-2094-1-1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: