vb问题 很简单的

来源:百度知道 编辑:UC知道 时间:2024/05/10 08:33:27
如果将文本框的maxlenghth属性设置为0,则文本框中的字符不能超过
A)8kb B)16kb C)32kb D)64kb
为什么,说明一下,谢谢!!

maxlenghth属性设置为0,则文本框中显示的字符数不能超过32kb(单字节)。
Private Sub Form_Load()
Text1 = "maxlenghth0"
Text1 = Text1 + Text1 + Text1 + Text1 + Text1 Text1 = Text1 + Text1 + Text1 + Text1 + Text1 + Text1
Text1 = Text1 + Text1 + Text1 + Text1 + Text1 + Text1
Text1 = Text1 + Text1 + Text1
Text1 = Text1 + Text1 + Text1 + Text1 + Text1 + Text1 & "OK"
Text2 = Len(Text1)
Text1.SelStart = Len(Text1)
Text1.SelLength = 1
End Sub

Private Sub Text1_Change()
Text2 = Len(Text1)
Text1.SelStart = Len(Text1)
Text1.SelLength = 1
End Sub

Private Sub Form_Load()
Text1 = "1234567890"
For i = 0 To 12
Text1 = Text1 + Text1
Next i
Text2 = Len(Text1)
Text1.Text = Text1
End Sub

Private Sub Text1_Change()
Text2 = Len(Text1)

End Sub
改变I的大小分别为11、12、13、
可以得到最大结果为65535=2的10次方*64-1
一个数为一个字节因此为64kb