如何把RichTextBox中闪烁的光标去掉,而其中文字可以选定,就象Web页一样?

解决方案 »

  1.   

    当不满足条件时,禁止编辑用Enabled颜色会改变用Locked有光标会使人产生错觉,以为可以编辑
      

  2.   

    Private Sub Form_Load()
        RichTextBox1.MousePointer = 1
    End SubPrivate Sub RichTextBox1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        If RichTextBox1.SelText = "" And Button <> 1 Then
            Text1.SetFocus
        End If
    End SubPrivate Sub RichTextBox1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
        If RichTextBox1.SelText = "" And Button <> 1 Then
            Text1.SetFocus
            SendKeys "{Home}"
        End If
    End SubText1可为所以能得到焦点的任何控件,如果整个窗体只能有RichTextBox1控件时,可将Text1放在RichTextBox1控件的下面,这样就可以达到楼主的效果了!
      

  3.   

    TO:kpKelvin(蓝天上的白云)比我的方法简单实用:我把ShowCaret给拦截了,我就是嫌它太麻烦很好!谢谢
      

  4.   

    我想要的搜索 http://www.531d.com 找你想要的一切