如何对richtextbox控件的行高亮显示

解决方案 »

  1.   

    请用API函数实现!!!!!其他方法,斟酌加分!
      

  2.   

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const EM_SETSEL = &HB1Private Sub Command1_Click()
        Text1.Text = "12345678eweeqeqe1881eaaaaaaaaaaaaaaaaddddddddddddddd"
        Text1.SetFocus
        SendMessage Text1.hwnd, EM_SETSEL, 2, ByVal 20
    End Sub
      

  3.   

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const EM_SETSEL = &HB1Private Sub Command1_Click()
        Text1.Text = "12345678eweeqeqe1881eaaaaaaaaaaaaaaaaddddddddddddddd"
        Text1.SetFocus
        Text1.SelStart = 2
        Text1.SelLength = 20
    End Sub
    常规方法
      

  4.   

    对不起,是我没有把意思说清楚
    我指的是highlight richtextbox 的行背景色象ultra edit 那样,背景是黄色的