110,538
社区成员
发帖
与我相关
我的任务
分享
public class ComboBoxDraw : ComboBox
{
protected override void WndProc(ref System.Windows.Forms.Message m)
{
base.WndProc(ref m);
//拦截系统消息,获得当前控件进程以便重绘。
if (m.Msg == 0xf || m.Msg == 0x133)
{
this.DrawSize();
}
}
private void DrawSize()
{
this.Size = new System.Drawing.Size(20, 50);
}
}