在你的文件框的CHANGE方法中加入一些控制语句可以吧!比如,假如 If Len$(Text1.text) > 20 Then '自己设大小 text1.text=text1.text+chr(10)'加了一换行 end if 或你做一个函数,也可以,方法一样
Private Sub Text1_Change()
Static blnFlags As Boolean Const TEXTLEN = 10
If blnFlags = False Then blnFlags = True Exit Sub End If
Dim intPst As Integer intPst = InStr(StrReverse(Text1.Text), StrReverse(vbCrLf))
If intPst > 0 Then If intPst > TEXTLEN Then blnFlags = False Text1.Text = Text1.Text & vbCrLf Text1.SelStart = Len(Text1.Text) End If Else If Len(Text1.Text) >= TEXTLEN Then blnFlags = False Text1.Text = Text1.Text & vbCrLf Text1.SelStart = Len(Text1.Text) End If End If
If Len$(Text1.text) > 20 Then '自己设大小
text1.text=text1.text+chr(10)'加了一换行
end if
或你做一个函数,也可以,方法一样
Static blnFlags As Boolean
Const TEXTLEN = 10
If blnFlags = False Then
blnFlags = True
Exit Sub
End If
Dim intPst As Integer
intPst = InStr(StrReverse(Text1.Text), StrReverse(vbCrLf))
If intPst > 0 Then
If intPst > TEXTLEN Then
blnFlags = False
Text1.Text = Text1.Text & vbCrLf
Text1.SelStart = Len(Text1.Text)
End If
Else
If Len(Text1.Text) >= TEXTLEN Then
blnFlags = False
Text1.Text = Text1.Text & vbCrLf
Text1.SelStart = Len(Text1.Text)
End If
End If
End Sub
Montaque==Digitalboy==Houyongfeng==Monkey
TO:NETBOY 具体怎么实现啊!谢了!