View Single Post
  #4 (permalink)  
Old 08-12-2008, 09:34 PM
mike2ppc mike2ppc is offline
Junior Member
 
Join Date: Feb 2008
Location: Germany
Posts: 11
Default

Thanks for all the idea,
my final solution is now

On Form1 are 2 TextBox Controls:

Sub App_Start
AddEvent("TextBox1",KeyPress,"TextBox_maxC5_KeyPre ss")
AddEvent("TextBox2",KeyPress,"TextBox_maxC5_KeyPre ss")
Form1.Show
End Sub


Sub TextBox_maxC5_KeyPress (key)
If StrLength(Control(Sender))=5 AND _
( IsLetter(key) OR IsNumber(key) ) Then
Control(Sender).IgnoreKey
End If
End Sub
Reply With Quote