谁有这种自定义控件的源码 本帖最后由 SL0413 于 2010-08-31 11:33:38 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 label控件,在Font属性中选中下划线,在Text属性中输入若干个空格,完毕! 真不是你说的这个意思...label 这个可以不说...主要是label后面的内容,______可以看成是TextBox控件..不过以_____的形式显式____的最后面还要包含一个按钮,并且_____有输入光标..可接受用户输入.. 做一个复合控件;前面是个TextBox后面是一个button() 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 你没有听说过有种函数叫:windowsAPI吗?using System.Runtime.InteropServices; [DllImport("Gdi32.dll")] public extern static IntPtr CreateRectRgn(int left, int top, int right, int bottom); [DllImport("User32.dll")] public extern static int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bredraw);private void button2_Click(object sender, EventArgs e) { IntPtr hrgn = CreateRectRgn(1, 1, textBox1.Width - 1, textBox1.Height); SetWindowRgn(textBox1.Handle, hrgn, true); } 【非C#高手不能解决!!!】 如何用代码修改页面边距? 关于arraylist的复制和合并问题 Form1,Form2两个窗口交换数据问题 小问题!! 解释一下C#代码 求Gmail邀请函 再次询问: 怎样使用crystalReportViewer实现直接打印,操作打印机参数和纸张大小参数? 没有人知道嘛?100分奉上 谁有C#开发的MIS源代码(结构标准、清晰),请发给我一份,谢谢! 监视进程的问题。 C#做的Windows服务无法实现开机后启动 如何在textbox中把字符串以货币形式显示!
真不是你说的这个意思...label 这个可以不说...主要是label后面的内容,______可以看成是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
using System.Runtime.InteropServices; [DllImport("Gdi32.dll")]
public extern static IntPtr CreateRectRgn(int left, int top, int right, int bottom);
[DllImport("User32.dll")]
public extern static int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bredraw);private void button2_Click(object sender, EventArgs e)
{
IntPtr hrgn = CreateRectRgn(1, 1, textBox1.Width - 1, textBox1.Height);
SetWindowRgn(textBox1.Handle, hrgn, true);
}