M
Martin
Hi all,
I'm trying to make a subclass of the Textbox. One of the things I did there
is the following:
Protected Overrides Sub OnLeave(ByVal e As System.EventArgs)
If Me.DataType = 1 Or Me.DataType = 2 Then
If IsNumeric(Me.Text) Then
Me.TextAlign = HorizontalAlignment.Right
End If
End If
MyBase.OnLeave(e)
End Sub
For the sake of clarity I removed all the code that doesn't pertain to this
problem.
The offending code is the setting of the TextAlign property. This causes the
focus to go back to the instance. In other words: When I try to tab to the
next control on the form, the OnEnter event occurs again, and this control
keeps the focus. When I take the setting of the TextAlign property out, the
focus changes normally.
Any ideas on how to prevent the focus shifting back when setting this
property?
Tia,
Martin
I'm trying to make a subclass of the Textbox. One of the things I did there
is the following:
Protected Overrides Sub OnLeave(ByVal e As System.EventArgs)
If Me.DataType = 1 Or Me.DataType = 2 Then
If IsNumeric(Me.Text) Then
Me.TextAlign = HorizontalAlignment.Right
End If
End If
MyBase.OnLeave(e)
End Sub
For the sake of clarity I removed all the code that doesn't pertain to this
problem.
The offending code is the setting of the TextAlign property. This causes the
focus to go back to the instance. In other words: When I try to tab to the
next control on the form, the OnEnter event occurs again, and this control
keeps the focus. When I take the setting of the TextAlign property out, the
focus changes normally.
Any ideas on how to prevent the focus shifting back when setting this
property?
Tia,
Martin