Odd Textbox Behavior


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
The SF textbox control is exhibiting very odd behavior.  As soon as a user taps the space bar the cursor is sent to the beginning of the textbox.  The same behavior seems to be happening when the decimal point is used, too.

I am forced to replace all SF textboxes with DX textedit controls.  I hope this solves the problem.

Any idea what might have happened on those controls?

Bill

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Any idea what might have happened on those controls?

Do you have any Trim options set on the field properties?  This can cause this type of behavior when the field is evalutated.  You can get around this by either changing the property update to occur OnValidation instead of OnPropertyChanged...or create your own textbox and inherit the SF Textbox and add this code:


Private _PreviousText As String = String.Empty


''' <summary>
''' Overrides the OnTextChanged() method of the base class to prevent the firing
''' of the TextChanged event when a trimmed string is entered.
''' </summary>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
    '-- If the previous saved text value is not equal to the new text value
    '   then allow the event to fire, otherwise, don't fire the event
    If Not Me._PreviousText.Trim().Equals(Me.Text.Trim()) Then
        MyBase.OnTextChanged(e)
    End If
    '-- Update the previous text
    Me._PreviousText = Me.Text
End Sub


Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
That makes sense.  I do have some trim() stuff on some of those fields (not the numeric ones where the decimal point does the same thing).  I'll look into that a little more.  I wonder why the DevEx textedit control works and not the SF textbox.  Ahh, the mysteries of life.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search