using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace DataRelationAndConstraint
{
class ComboBoxPlay : ComboBox
{
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x000F)
Draw();
} private void Draw()
{
Graphics gra = this.CreateGraphics();
gra.DrawRectangle(Pens.Red, this.Bounds.X - 3, this.Bounds.Y - 3, this.Bounds.Width - 2, this.Bounds.Height - 2);
}
}
}
我想在控件上画一个红色的框,怎么画不出来呀?
本来想做一个颜色选择的ComboBox控件,类似于属性框里面BackgroudColor属性的颜色选择框,但现在连一个框都画不出来就别说实现更复杂的功能了。望高手指点。
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace DataRelationAndConstraint
{
class ComboBoxPlay : ComboBox
{
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x000F)
Draw();
} private void Draw()
{
Graphics gra = this.CreateGraphics();
gra.DrawRectangle(Pens.Red, this.Bounds.X - 3, this.Bounds.Y - 3, this.Bounds.Width - 2, this.Bounds.Height - 2);
}
}
}
我想在控件上画一个红色的框,怎么画不出来呀?
本来想做一个颜色选择的ComboBox控件,类似于属性框里面BackgroudColor属性的颜色选择框,但现在连一个框都画不出来就别说实现更复杂的功能了。望高手指点。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货