怎样让文本框看上去像一条直线一样,然后文字输入在上面显示就是去掉左边、上边、右边的线,只有底部的线

解决方案 »

  1.   

    Text.BorderStyle = 0
    再在下面画一条线。
      

  2.   

    Private WithEvents text1 As TextBox
    Private WithEvents line1 As Line
    Private Sub Form_Load()
    Set text1 = Me.Controls.Add("vb.textbox", "text1", Me)
    Set line1 = Me.Controls.Add("vb.line", "line1", Me)
    text1.Visible = True
    text1.BackColor = Me.BackColor
    line1.Visible = True
    text1.BorderStyle = 0
    text1.Move 0, 0, 2500, 400
    text1.FontSize = 16
    line1.X1 = 0
    line1.X2 = 2500
    line1.Y1 = 400
    line1.Y2 = 400
    line1.BorderColor = vbBlue
    line1.BorderWidth = 2
    text1.Text = "中华人民共和国"
    End Sub
      

  3.   

    Text.BorderStyle = 0
    Text.FontUnderline =True
    '将输入的文字设置为带下划线的不就行了
      

  4.   

    label控件运行时用户是无法输入的,还是用一楼的方法简单
      

  5.   

    northwolves(狼行天下) 真牛!
    收藏之
      

  6.   

    设置:
    Text.BorderStyle = 0
    Text1.FontUnderline = True 
    就可以了
      

  7.   

    设置:
    Text1.BorderStyle = 0
    Text1.FontUnderline = True 
    就可以了
      

  8.   

    如果这样不合要求,还有一个办法:Dim Xe As LONG
    Dim Xb As Long
    Dim Y As Long
    WITH TEXT1
       Xb = .Left
       Xb = Xe + .Width
       Y = .Top + .Height
    End With
    Me.AutoRedraw = True
    line(Xb,Y)-(Xe,Y)
    Me.refresh
    这是在界面上画出来的线。