Hi,
I have come up with a solution, its not 100% but I think its as good as I'm
going to get it.
If you click and move your mouse over the label from start to finish you get
a little flicker.
But apart from that it works, you can still use URLs too.
Well just in case anyone is reading this in the future here's to code....
Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ReadOnlyRichTextBox
Inherits RichTextBox
Private Declare Auto Function HideCaret Lib "user32.dll" (ByVal hwnd As
IntPtr) As Int32
Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)
HideCaret(Me.Handle)
End Sub
Protected Overrides Sub OnEnter(ByVal e As EventArgs)
HideCaret(Me.Handle)
End Sub
<DefaultValue(True)> Public Shadows Property [ReadOnly]() As Boolean
Get
Return True
End Get
Set(ByVal Value As Boolean)
End Set
End Property
<DefaultValue(False)> Public Shadows Property TabStop() As Boolean
Get
Return False
End Get
Set(ByVal Value As Boolean)
End Set
End Property
Public Sub New()
MyBase.ReadOnly = True
MyBase.TabStop = False
Me.SetStyle(ControlStyles.Selectable, False)
HideCaret(Me.Handle)
End Sub
Private Sub ReadOnlyRichTextBox_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles MyBase.SelectionChanged
Me.SelectionLength = 0
HideCaret(Me.Handle)
End Sub
Private Sub ReadOnlyRichTextBox_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
HideCaret(Me.Handle)
End Sub
Private Sub ReadOnlyRichTextBox_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
HideCaret(Me.Handle)
End Sub
End Class
If anyone improves on that please post in here, even months ahead.