View Single Post
  #2 (permalink)  
Old 08-11-2008, 07:09 PM
taximania's Avatar
taximania taximania is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 263
Awards Showcase
Beta Tester 
Total Awards: 1
Default

This was not done by me.
I think it's agraham who wrote this code.
I think the number 2 is correct for your needs.

Code:
Sub TextBox1_KeyPress (key)
    If StrLength( textbox1.Text) >=2 Then	
        If Asc(key)>31 Then
            ss = Textbox1.SelectionStart
            Textbox1.Text= SubString(Textbox1.Text,0,2)
            Textbox1.SelectionStart = ss
        End If
    End If
End Sub
__________________
I'm a little crazy at times . . . .

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote