如何改变textbox边框的颜色!

解决方案 »

  1.   

    把 TextBox 设置为无边框的,加个 Rectangle 的 Shape 做边框就好
      

  2.   

    界面是画出来的,自己用API画就可以了。
      

  3.   

    你可以处理文本框事件使用WindowsApi画界面,也可以使用VB的SHARP、line等控件来绘制。
      

  4.   

    都没有好的方法!谁能给个控件!
    [email protected]
      

  5.   

    Private Sub Form_Load()
        Dim hrgn As Long
        hrgn = CreateRoundRectRgn(2, 2, ScaleX(Text1.Width - 1, vbTwips, vbPixels), ScaleY(Text1.Height - 1, vbTwips, vbPixels), 5, 5)
        SetWindowRgn Text1.hWnd, hrgn, True
        DeleteObject hrgn
        End Sub
      

  6.   

    Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
    Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hrgn As Long, ByVal bRedraw As Boolean) As Long
    Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer) As Long
    Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
    Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
    Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
    Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
    Private Const PS_SOLID = 0
        Private Sub Form_Load()
        Form1.ScaleMode = 3
        Dim i As Long
        Dim pen As Long
        i = CreatePen(PS_SOLID, 1, RGB(234, 3, 45))
        pen = SelectObject(Me.hdc, i)
        Dim hrgn As Long
        hrgn = CreateRoundRectRgn(2, 2, Text1.Width - 1, Text1.Height - 1, 10, 10)
        SetWindowRgn Text1.hWnd, hrgn, True
        DeleteObject hrgn
        RoundRect Me.hdc, Text1.Left, Text1.Top, Text1.Left + Text1.Width, Text1.Height + Text1.Top, 10, 10
        SelectObject Me.hdc, pen
        DeleteObject i
        End Sub
      

  7.   

    有没有这样的控件啊!
    给一个啊!
    我也要用到!
    [email protected]