반응형 c# MaxLength1 [C#] c# Winform Text 박스 - 글자수 제한, 리셋 안녕하세요 C#에서 사용하는 Text 박스 글자수 제한 및 Text 박스 리셋하는 간단한 코드 입니다. 1. Text Box MaxLenght Check public string CheckBytesTextBox(int maxLength,TextBox txtContents) { string contents = txtContents.Text; Byte[] contentsByte = Encoding.Default.GetBytes(contents); if (contentsByte.Length > maxLength) { MessageBox.Show($"{maxLength} Bytes를 초과하여 입력하실 수 없습니다."); while (contentsByte.Length > maxLength) { //한글자씩 줄여.. 2022. 7. 9. 이전 1 다음 반응형