类似与 TextBox 但是除了底边框,就没有其他的三边了. 急.

解决方案 »

  1.   

    将Textbox的BorderStyle设置成None,再在底边的位置放一个label,label的borderStyle设置成FixedSingle  :)
      

  2.   

    findcaiyzh 的方法还是不错的,如果在窗体的paint 时间中,
    给每一个文本框划一条直线如何做呢
     ?
      

  3.   

    额!一定得用哪个吗自己做个控件类库就行了,继承TEXTBOX类,然后把边框都去掉,用GDI+画一条线到最底下,OK?
      

  4.   

    sjm2003 ,高手,示范一个吧,没有怎么做过自定义组件
      

  5.   

    --------------------------------
     参考了上面几位的好办法,参考了下面这位大侠的方法,
     问题倒是解决了,
     谢谢 如这位大侠看到,也请进来拿分. 谢谢各位.
    --------------------------------加为好友 
    发送私信 
    在线聊天
     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);