본문 바로가기
C#(CSharp)/WPF

여러 줄 TextBox 컨트롤 만들기

by swconsulting 2015. 3. 21.
<TextBox
  Name="tbMultiLine"
  TextWrapping="Wrap"
  AcceptsReturn="True"
  VerticalScrollBarVisibility="Visible"
>
  This TextBox will allow the user to enter multiple lines of text.  When the RETURN key is pressed, 
  or when typed text reaches the edge of the text box, a new line is automatically inserted.
</TextBox>


TextWrapping attribute to Wrap will cause entered text to wrap to a new line when the edge of the TextBox control is reached, automatically expanding the TextBox control to include room for a new line, if necessary." xml:space="preserve" style="background-color: rgb(255, 255, 225);"><sentencetext xmlns="http://www.w3.org/1999/xhtml">TextWrapping 특성을 Wrap으로 설정하면 TextBox 컨트롤의 가장자리에 도달할 때 텍스트가 새 줄로 바뀌고, 필요한 경우 TextBox 컨트롤이 자동으로 늘어나 새 줄을 위한 공간이 확보됩니다.</sentencetext>

AcceptsReturn attribute to true causes a new line to be inserted when the RETURN key is pressed, once again automatically expanding the TextBox to include room for a new line, if necessary." xml:space="preserve">AcceptsReturn 특성을 true로 설정하면 Return 키를 눌렀을 때 새 줄이 삽입되고 한 번 더 누르면 필요한 경우 TextBox 컨트롤이 자동으로 늘어나 새 줄을 위한 공간이 확보됩니다.

VerticalScrollBarVisibility attribute adds a scroll bar to the TextBox, so that the contents of the TextBox can be scrolled through if the TextBox expands beyond the size of the frame or window that encloses it." xml:space="preserve">VerticalScrollBarVisibility 특성은 스크롤 막대를 TextBox에 추가하므로 둘러싼 프레임이나 창의 크기를 초과하여 TextBox가 늘어날 경우에도 TextBox의 내용을 스크롤할 수 있습니다.


참고 URL : https://msdn.microsoft.com/ko-kr/library/ms742157(v=vs.110).aspx