Hi,
I was able to create a class that inherited a TextEdit and add it one property, the SelectAllOnFocus:
Visual BasicOption Strict On
Imports DevExpress.XtraEditors
Imports System.ComponentModel
Public Class XTextEdit
Inherits TextEdit
Private _AlreadyFocused As Boolean
<Category("Behavior")> _
<DefaultValue(False)> _
<Description("On focus, SelectAll")> _
Public Property SelectAllOnFocus As Boolean
Protected Overrides Sub OnLeave(e As EventArgs)
MyBase.OnLeave(e)
If SelectAllOnFocus Then
_AlreadyFocused = False
End If
End Sub
Protected Overrides Sub OnGotFocus(e As EventArgs)
MyBase.OnGotFocus(e)
If SelectAllOnFocus Then
If MouseButtons = Windows.Forms.MouseButtons.None Then
_AlreadyFocused = True
SelectAll()
End If
End If
End Sub
Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
MyBase.OnMouseUp(e)
If Not _AlreadyFocused AndAlso SelectionLength = 0 Then
_AlreadyFocused = True
SelectAll()
End If
End Sub
End Class
That code works as expected. Now, I'd like to add that same property to a RepositoryItemTextEdit. Since a RITE has none of the events I need, how would I be able to do that?
Thanks for your time.