Backspace behavior

1
2
3
4
5
6
7
8
With TextBox1
  If .SelStart Then
    .SelStart = .SelStart - 1
    .SelLength = 1
    .SelText = ""
  End If
 .SetFocus
End With


I used to use this code in vb6 for backspace behaviour. How to modify this for c++?

Eg.
In textbox_change event; Not to allow character input if the value of thextbox is going to exceed 10000
1
2
3
4
5
6
7
8
9
10
With TextBox1
If Val(.Text) > 10000 Then
  If .SelStart Then
    .SelStart = .SelStart - 1
    .SelLength = 1
    .SelText = ""
  End If
 .SetFocus
End If
End With
Last edited on
Topic archived. No new replies allowed.