Completed
Last Updated: 31 Jul 2013 06:28 by ADMIN
ADMIN
Anton
Created on: 31 Jul 2013 06:28
Category: Editors
Type: Bug Report
0
FIX. RadMaskEditBox - does not work correctly when the whole text is selected and user presses key "Enter".
RadMaskEditBox - does not work correctly when the whole text is selected and user presses key "Enter". Control removes the last character.

Workaround:

Public Class Form1

    Dim text1 As String
    Dim text2 As String

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyData = Keys.Enter Then
            SendKeys.Send("{TAB}")
        End If

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard
        Me.RadMaskedEditBox2.MaskType = Telerik.WinControls.UI.MaskType.Standard
        Me.RadMaskedEditBox1.Mask = "00/00/00"
        Me.RadMaskedEditBox1.Text = "__/__/__"
        Me.RadMaskedEditBox2.Mask = "00/00/00"
        Me.RadMaskedEditBox2.Text = "__/__/__"

    End Sub

    Private Sub RadMaskedEditBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox1.GotFocus
        RadMaskedEditBox1.SelectAll()
        text1 = Me.RadMaskedEditBox1.Text

    End Sub

    Private Sub RadMaskedEditBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox1.LostFocus
        Me.RadMaskedEditBox1.Text = text1
    End Sub

    Private Sub RadMaskedEditBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RadMaskedEditBox1.KeyDown
        If e.KeyData = Keys.Enter Then
            text1 = Me.RadMaskedEditBox1.Text
        End If
    End Sub


    Private Sub RadMaskedEditBox2_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox2.GotFocus
        RadMaskedEditBox2.SelectAll()
        text2 = Me.RadMaskedEditBox2.Text
    End Sub

    Private Sub RadMaskedEditBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox2.LostFocus
        Me.RadMaskedEditBox2.Text = text2
    End Sub

    Private Sub RadMaskedEditBox2_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RadMaskedEditBox2.KeyDown
        If e.KeyData = Keys.Enter Then
            text2 = Me.RadMaskedEditBox2.Text
        End If
    End Sub

End Class
0 comments