2017-10-19 13 views
0

Hyperlinkに表示します。ご覧のとおり、今度はFlowDocumentの一部で、ハイパーリンクの横に座っています!しかし、私はそれがハイパーリンク上に現れるように、絶対的な位置を持つことを望んでいます!どうやってやるの?WPFでのFlowDocumentでのUIElementの絶対配置

<FlowDocumentScrollViewer> 
    <FlowDocument> 
     <Paragraph> 
      The maximum speed is 
      <Hyperlink>150</Hyperlink> 
      <InlineUIContainer> 
       <Button>No way!</Button> 
      </InlineUIContainer> 
      in this road! 
     </Paragraph> 
    </FlowDocument> 
</FlowDocumentScrollViewer> 

答えて

1

あなたはUIElementから継承複数のオブジェクトを「スタック」するStackPanelを使用することができます。 HyperlinkUIElementから継承されませんが、これはHyperlinkContentControlの内側に置くことで回避できます。 Buttonが(コメントを参照)Hyperlinkの上部(より高いz順序)に現れると、コードを編集

<FlowDocumentScrollViewer> 
    <FlowDocument> 
     <Paragraph> 
      The maximum speed is 
      <StackPanel> 
       <Button>No way!</Button> 
       <ContentControl HorizontalAlignment="Center"> 
        <Hyperlink>150</Hyperlink> 
       </ContentControl> 
      </StackPanel> 
      in this road! 
     </Paragraph> 
    </FlowDocument> 
</FlowDocumentScrollViewer> 

:ここ

は実施例です。

<FlowDocumentScrollViewer> 
    <FlowDocument> 
     <Paragraph> 
      The maximum speed is 
      <Grid> 
       <Button>No way!</Button> 
       <ContentControl HorizontalAlignment="Center"> 
        <Hyperlink>150</Hyperlink> 
       </ContentControl> 
      </Grid> 
      in this road! 
     </Paragraph> 
    </FlowDocument> 
</FlowDocumentScrollViewer> 
+0

ありがとうございますが、私はそれがハイパーリンクの上にあることを願っています。 – Vahid

+0

ハイパーリンクが見えないように「上に」したいのですか?もしそうなら、なぜハイパーリンクが必要ですか? – DinoM

+0

私はハイパーリンクの後に表示されたい!私は今簡単にボタンを使用しました!スライダーになります。ハイパーリンクは整数値になり、クリックするとスライダが表示されます。それが私の最終目標です! – Vahid