how can i insert a TextBlock control in a Hyperlink in c# coding. similar to
<TextBlock> <Hyperlink>a</Hyperlink></textblock
in C#. i'm unable to find content property in Hyperlink. Thanks in advance.
views:
163answers:
2
A:
Use an HyperlinkButton, not an Hyperlink (which is meant to be used in a FlowDocument, with Inlines inside)
HyperlinkButton has the Content property as content property.
So:
TextBlock tb = new TextBlock();
// set tb's properties
HyperlinkButton hlb = new HyperlinkButton();
// set hlb's properties
hlp.Content = tb;
Timores
2010-04-15 10:25:23
hi Timores, unable to find HyperlinkButton in System.Windows.Controls
fad
2010-04-15 10:36:14
It is in the System.Windows assembly. See http://msdn.microsoft.com/en-us/library/system.windows.controls.hyperlinkbutton(VS.95).aspx
Timores
2010-04-15 12:13:57
HyperlinkButton is only a Silverlight control. not present in WPF
Simon_Weaver
2010-08-31 02:59:36