Sign in or 

People just like you can add or edit the content on this site. If you want to try editing, but aren't ready to add to this site, try our demo area.
Read more about editing pages at Wetpaint Central.
)
'For TextBoxes with MaxLength property > 0.End Sub
'Tabs only if the cursor is at the end of the text.
'Sub Text1_Change ()' Call AutoTab'End Sub
Dim Text1 As Control
Dim Text As String
Dim Length As Integer
Dim MaxLen As Integer
On Error GoTo AutoTabTrap
Set Text1 = Screen.ActiveControl
Text = Text1.Text
Length = Len(Text)
MaxLen = Text1.MaxLength
If Length > MaxLen Then'How can this be? Maybe it was pasted.ElseIf Length = MaxLen And Text1.SelStart = MaxLen Then
'This causes another change event so we'll be back.
Text1.Text = Left$(Text, MaxLen)SendKeys "{TAB}"End If
AutoTabTrap:
Exit Sub
2buck |
Latest page update: made by 2buck
, Dec 1 2006, 11:42 PM EST
(about this update
About This Update
Edited by 2buck
view changes - complete history) |
|
More Info: links to this page
|