16,554
社区成员
发帖
与我相关
我的任务
分享
System.Text.Encoding.Default.GetByteCount("内容")
Sub TextBox1_KeyPress(object sender, KeyPressEventArgs e)
if (System.Text.Encoding.Default.GetByteCount(TextBox1.Text) >= 12) and not char.IsControl(e.KeyChar) then
e.Handled = true;
end if
end sub
If System.Text.Encoding.Default.GetByteCount(m1.Text) > 11 And e.KeyChar <> Chr(8) Then
e.Handled = True
Else
e.Handled = False
End If