首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

哪位高手有这种自定义控件的源码

2012-05-28 
谁有这种自定义控件的源码单位名称:____________________…(…是按钮)____________________跟TextBox一个功

谁有这种自定义控件的源码
单位名称:____________________…  


(…是按钮)

____________________ 跟TextBox一个功能.

[解决办法]
public class UnderLineBox : TextBox 

private bool m_underLine; 

public bool UnderLine 

get { return m_underLine; } 
set

if (this.m_underLine != value) 

if(value) 

this.BorderStyle = BorderStyle.None; 

m_underLine = value; 



protected override void WndProc(ref Message m) 

base.WndProc(ref m); 
if(m.Msg == 0xf || m.Msg == 0x14 || m.Msg == 0x85) 

if(this.BorderStyle == BorderStyle.None) 

if(m_underLine) 

using(Graphics g = Graphics.FromHwnd(this.Handle)) 

g.DrawLine(SystemPens.ControlText, 0, this.Height - 1, this.Width - 1, this.Height - 1); 






http://topic.csdn.net/u/20090214/11/19c2a6f9-090b-45c2-a1fa-36712b2b1090.html

热点排行