기본 제공 방법이 없습니다. 일부 작업 차선책이 스레드에서 언급 : 그들은 SelectionAlignment
속성을 (this page for how 참조) 오버라이드 (override) Justify
로 설정, 재정의 RichTextBox
을 사용하는 것이 좋습니다
http://social.msdn.microsoft.com/Forums/zh/winforms/thread/aebc7ac3-4732-4175-a95e-623fda65140e
. 재정의
배짱이의 PInvoke 호출을 중심으로 돌고 : (난 당신이 텍스트보다 더 그리기한다고 가정부터)이 기존 모델에 통합 할 수있는 방법을 잘 확실하지
PARAFORMAT fmt = new PARAFORMAT();
fmt.cbSize = Marshal.SizeOf(fmt);
fmt.dwMask = PFM_ALIGNMENT;
fmt.wAlignment = (short)value;
SendMessage(new HandleRef(this, Handle), // "this" is the RichTextBox
EM_SETPARAFORMAT,
SCF_SELECTION, ref fmt);
을하지만 수도 너의 유일한 선택이다.
float extra_space = rect.Width - total_width; // where total_width is the sum of all measured width for each word
int num_spaces = words.Length - 1; // where words is the array of all words in a line
if (words.Length > 1) extra_space /= num_spaces; // now extra_space has width (in px) for each space between words
나머지는 : 당신이 전체 단락의 주어진 폭을 알고있을 때 당신은 각각 별도의 행에 텍스트를 정당화 할 수 -