This will work but they can still cut and paste something in but you'll need to handle that seperate if its an issue.
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If TextBox1.Text.Length > 0 Then 'must have text Dim c() As Char = TextBox1.Text.ToCharArray() 'get char array 'check last element of char against current keychar If e.KeyChar = c(c.GetUpperBound(0)) Then e.Handled = True End If End Sub




Reply With Quote