<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Creating MarkupRoutedEvent for Hyperlink in code</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : MarkupLabel Control : Creating MarkupRoutedEvent for Hyperlink in code]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 13 Jun 2026 11:54:50 +0000</pubDate>
  <lastBuildDate>Sat, 25 Jun 2011 11:25:30 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=18588</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Creating MarkupRoutedEvent for Hyperlink in code :   Thanks, that worked a treat....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65010&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65010</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4627">Andrew666</a><br /><strong>Subject:</strong> 18588<br /><strong>Posted:</strong> 25 June 2011 at 11:25am<br /><br />Thanks, that worked a treat.&nbsp; I wasn't using the "AddHandler" method.&nbsp; As usual the controls do what I want - if only I can work out how ;)<div>&nbsp;</div><div>--A</div>]]>
   </description>
   <pubDate>Sat, 25 Jun 2011 11:25:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65010&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65010</guid>
  </item> 
  <item>
   <title><![CDATA[Creating MarkupRoutedEvent for Hyperlink in code : Here&amp;#039;s how I create Hyperlinks...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65008&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65008</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 18588<br /><strong>Posted:</strong> 24 June 2011 at 5:43pm<br /><br />Here's how I create Hyperlinks with a ClickEvent:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Option Explicit<br><br>Public Sub HyperlinkClicked(po_Source As Object, po_Args As Object)<br>&nbsp;&nbsp; Dim lo_Hyperlink As MarkupHyperlink<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; If TypeOf po_Source Is MarkupHyperlink Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lo_Hyperlink = po_Source<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox lo_Hyperlink.Tag<br>&nbsp;&nbsp; End If<br>End Sub<br><br>Private Sub Form_Load()<br>&nbsp;&nbsp; Dim lo_Hyperlink As MarkupHyperlink<br>&nbsp;&nbsp; Dim lo_TextBlock As MarkupTextBlock<br>&nbsp;&nbsp; Dim lo_Run As MarkupRun<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; With Me.MarkupLabel1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With .MarkupContext<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lo_Run = .CreateObject("Run")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With lo_Run<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Text = "This is a link"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lo_Hyperlink = .CreateObject("Hyperlink")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With lo_Hyperlink<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Inlines.Add lo_Run<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Tag = "http://www.codejock.com"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AddHandler .ClickEvent, "HyperlinkClicked"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lo_TextBlock = .CreateObject("TextBlock")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With lo_TextBlock<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Inlines.Add lo_Hyperlink<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .MarkupContext.SetHandler Me<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set .MarkupUIElement = lo_TextBlock<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; End With<br>End Sub<br></pre></td></tr></table><br><br>Is that helpful? If not, can you post a small sample of what you are trying to do, and I will take a look at it to see if I can understand your problem better through code instead of pseudo-code.<br><br>]]>
   </description>
   <pubDate>Fri, 24 Jun 2011 17:43:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65008&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65008</guid>
  </item> 
  <item>
   <title><![CDATA[Creating MarkupRoutedEvent for Hyperlink in code :   I&amp;#039;m trying to programmatically...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65006&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65006</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4627">Andrew666</a><br /><strong>Subject:</strong> 18588<br /><strong>Posted:</strong> 24 June 2011 at 2:54pm<br /><br />I'm trying to programmatically create and add a Hyperlink object with a named Click property to a TextBlock using the following pseudo code.&nbsp; It doesn't work and fails when assigning the MarkupRoutedEvent object:<div>&nbsp;</div><div>1. Find MarkupTextBlock object using MarkupUIElement.FindName method</div><div>2. Clear all the Inlines</div><div>3. Create the MarkupHyperlink, MarkupRun and MarkupRoutedEvent objects using MarkupContext.CreateObject</div><div>4. Set Run Text property</div><div>5. Set MarkupHyperlink Name property</div><div>6. Set MarkupRoutedEvent Name property&nbsp;&#091; fails here &#093;</div><div>7. Assign MarkupRoutedEvent to MarkupHyperlink ClickEvent property</div><div>8. Add Run to MarkupHyperlink Inlines</div><div>9. Add MarkupHyperlink to MarkupTextBlock Inlines</div><div>&nbsp;</div><div>Everything works if I exclude the RoutedEvent steps 6 and 7.&nbsp; Thanks.</div><div>&nbsp;</div><div><br>Regards</div><div>&nbsp;</div><div>--Andrew</div>]]>
   </description>
   <pubDate>Fri, 24 Jun 2011 14:54:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18588&amp;PID=65006&amp;title=creating-markuproutedevent-for-hyperlink-in-code#65006</guid>
  </item> 
 </channel>
</rss>