手動フロー原稿をセットし、フロードキュメント内のハイパーリンクを作成してみなければならない...ここで
は、以下のリンクから取られたいくつかのテキストです: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/99ae9d9c-1dd4-4acd-8d5d-6eb739adeb98
」 こんにちは、
段落/節/表へのハイパーリンクを作成する小さな例を次に示します。
o Webサイトでは、ナビゲーション用のフレームコントロールを作成できます。
public Window1()
{
InitializeComponent();
// add a Frame for navigation
Frame frame = new Frame();
this.Content = frame;
//add FlowDocument
FlowDocument doc = new FlowDocument();
frame.Navigate(doc);
//add Table
Table table = new Table();
doc.Blocks.Add(table);
TableRowGroup group = new TableRowGroup();
table.RowGroups.Add(group);
TableColumn col1 = new TableColumn();
TableColumn col2 = new TableColumn();
table.Columns.Add(col1);
table.Columns.Add(col2);
TableRow row1 = new TableRow();
TableCell cel1 = new TableCell();
row1.Cells.Add(cel1);
group.Rows.Add(row1);
//add Section
Section mySection = new Section();
//add section to the Table cell.
cel1.Blocks.Add(mySection);
Paragraph paraValue = new Paragraph();
Hyperlink hl = new Hyperlink(new Run("Click Here to Google"));
hl.Foreground = Brushes.Red;
paraValue.Inlines.Add(hl);
hl.FontSize = 11;
hl .NavigateUri =new Uri ("Http://www.google.cn");
mySection.Blocks.Add(paraValue);
}
: - > FlowDocument - >表 - >セクション - - >パラグラフ>ハイパーリンク
コードビハインドで
フレーム:この例では要素の階層関係は次のようです
ご質問がありましたら、お気軽にお問い合わせください。
ありがとうございました。 「あなたはそれが本格FlowDocumentであるという要件を持っていない場合は、あなただけの昔ながらのWPFのTextBlockを使用し、その中にハイパーリンクを置くことができる
おかげさまで、あなたはHyperLinkとLinkLabelの違いを知っていますか? –
それらの間には多くの違いがあります。最大のものは、1つはWinFormsで、もう1つはWPFです。 –