Private Sub txtMessage_KeyPress(ByVal sender As Object, ByVal vv As System.Windows.Forms.KeyPressEventArgs) Handles txtMessage.KeyPress

Dim tmdataleft As Integer
Dim addby As Integer = 1

If tmdataleft = 160 Then
vv.Handled = True
tmdataleft = (tmdataleft + addby)
DataLeft.Text = tmdataleft
MsgBox(tmdataleft & " ELSE --- The Variable is less than 160")
End If
End Sub

well i have that for now, what I would like it to do is add(+1) for each letter/number typed into the box. and subtract 1 if the user backspaces, right now it just doesn't add at all.. if anyone could point me in the right direction i'd appreciate it =)

expression.length will give you the number of characters.

Dim intLetCount as integer

intLetCount = me.textbox.length

If intLetCount < 160 Then
     Do Something
     Do Something Else
End If

Hope that helps.


That worked out very well! Sorry I didn't know about the code tag!
Thank you so much cpopham!!

Glad it worked for you...