title image


Smiley Re: Eingabelaenge eine Text-Feldes
Hi!



Dim AlterText As String





Private Function PrüfeTextbox(TB As String, MaxZeilen As Byte, MaxZeichenZeile As Byte) As Boolean

Dim Ok As Boolean, Tmp As Variant, Temp() As String, i As Integer

Ok = True

Tmp = TB

Do While InStr(Tmp, vbCrLf) <> 0

Tmp = Mid(Tmp, InStr(Tmp, vbCrLf) + 1)

i = i + 1

Loop

If i > MaxZeilen Then

Ok = False

Else

Temp = Split(TB, vbCrLf)

For Each Tmp In Temp

If Len(Tmp) > MaxZeichenZeile Then

Ok = False

Exit For

End If

Next Tmp

End If

PrüfeTextbox = Ok

End Function





Private Sub Text1_Change()

If PrüfeTextbox(Text1.Text, 4, 4) = False Then

Text1.Text = AlterText

Else

AlterText = Text1.Text

End If

End Sub







MfG

Mr. S ICQ #67858520http://www.developersmanual.com/



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: