결론 : 사용자가 편집할 수 있게끔 하려면 TextBox, 아닌 경우 Label 사용 추천
There are a few pro's and con's to both.
Label
Pro's:
- Text is not copy able
- Cursor does not change
- Sets size based on text (if autosize is on, I think its on by default)
- Option to align text to the right (autosize off)
Con's:
- Text is not selectable/copy able
- Text might outgrow form/parent with autosize
TextBox
Pro's:
- Text is copy able
- Fixed size (also a con)
Con's:
- Does not autosize
- Height not adjustable (does not apply to rich textbox/multiline = true)
Reference : https://stackoverflow.com/questions/42764020/using-a-label-vs-using-a-textbox%EF%BB%BF
https://stackoverflow.com/questions/489220/text-box-vs-labels%EF%BB%BF
'프로그래밍 > C# (WinForms)' 카테고리의 다른 글
C#, WinForms ] float to hex / hex to float Converter (0) | 2023.04.09 |
---|---|
C#, LINQ ] Enumerable 클래스, Range(), Select(), Where(), ToArray() 메서드 (0) | 2023.04.09 |
C#, WinForms ] 계산기 구현 (0) | 2023.02.25 |
C#, WinForms ] label의 너비를 초과하는 글자 자르기 (0) | 2023.02.25 |
C# ] decimal 과 double 의 차이 (1) | 2023.02.25 |