类似与 TextBox 但是除了底边框,就没有其他的三边了. 急.
解决方案 »
- discuz 论坛POST数据的时候 来路不正确
- .net 2.0串口接收数据有哪几种方式?
- excel读取问题,一加HDR=Yes就报错
- 在一个FORM里取的值传到另一个FORM里?
- 为什么,我的DefaultView.RowFilter不管用
- 新手诚心请教问题!
- 算法问题
- compile c# prgram with NAnt. welcom to discussing it
- 关于文件加密问题?各位大侠指教!
- CSDN不错,可这个C#论坛不敢恭维,大家到www3.ccw.com.cn的.NET论坛看看
- 这个函数,怎么调用哪!protected virtual string FileName(string cf)
- 膨胀问题
给每一个文本框划一条直线如何做呢
?
参考了上面几位的好办法,参考了下面这位大侠的方法,
问题倒是解决了,
谢谢 如这位大侠看到,也请进来拿分. 谢谢各位.
--------------------------------加为好友
发送私信
在线聊天
hbxtlhx
平民百姓
等级:
发表于:2007-09-14 14:18:1810楼 得分:20
自已重写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);
}
}
}
}
}
}