나는 이것에 대한 답을 찾을 수 없었습니다. scrollviewer 내에서 표시되는 TextBlock을 사용하고 있습니다. TextWrapping 바꿈 설정된다 : I은 인라인 요소의 MouseEnter 이벤트에TextBlock (WPF C#)의 오른쪽 - 들쭉날쭉 한 인라인 요소의 문자 경계를 얻는 방법은 무엇입니까?
Regex.Split(text, @"(\s+)")
지금 :
<ScrollViewer VerticalScrollBarVisibility="Auto"
Width="{Binding Parent.ActualWidth, Mode=OneWay, RelativeSource={RelativeSource Self}}"
Height="{Binding Parent.ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}"
Name="theScrollViewer">
<Grid Background="White" >
<wc:CustomTextBlock
InLineText="{Binding Text, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
TextWrapping="Wrap"
WordPad="{Binding WordPad, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}"
/>
TextBlock입니다가 인라인 요소로 채워를 하나 개의 논리적 단어 채 각 요소에 의해 정의 된 와 경계 사각형을 만들 tyring 오전 : 인라인 요소가있는 TextBlock의 다음 행으로 포장 될 때
static void inline_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
Run Sender = sender as Run;
TextPointer tp0 = Sender.ContentStart;
TextPointer tp1 = Sender.ContentEnd;
Rect StartRect = tp0.GetCharacterRect(LogicalDirection.Forward);
Rect EndRect = tp1.GetCharacterRect(LogicalDirection.Backward);
StartRect.Union(EndRect);
.........................
}
본 명확하게 실패합니다.
인라인 요소의 표시 위치를 다음 행으로 "줄 바꿈"할 때 어떻게 찾을 수 있습니까? 의 시작 부분에 인라인의 끝 부분 주위에, 행의 끝에 인라인의 첫 번째 부분 주위
사각형
사각형을 : 나는 두 개의 사각형을 생성하는 방법을 찾고 있어요 다음 행.
이 도움말은 내가 flowdocuments를 처음 사용하는 것에 대해 높이 평가됩니다. 감사.