CMarkupStatic hyperlink text |
Post Reply |
Author | |
ibmldev
Groupie Joined: 17 October 2006 Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 22 September 2008 at 3:42pm |
Imitating Codejock sample code, I am using CMarkupStatic with markup text (simplified for this example)
<StackPanel><TextBlock>Two links <Hyperlink>Foo</Hyperlink> and <Hyperlink>Bar</Hyperlink> are embedded here</TextBlock></StackPanel> and then call the CMarkupStatic object's method AddHandler( CXTPMarkupHyperlink::m_pClickEvent, CreateMarkupClassDelegate( this, &MyDialogClass::OnHyperlinkClick ) ); which will call my OnHyperlinkClick() function when i click on either link. How can I tell which link was clicked? Ideally, I want to get the content text "Foo" or "Bar" inside OnHyperlinkClick() for processing. I saw a post about this here, but the so-called solution does not contain valid code. Can someone post exactly some modified code to extract the content string of the clicked hyperlink? |
|
BerntK
Groupie Joined: 15 September 2008 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Hi,
First add Tag='StringToGet' to markup like <StackPanel><TextBlock>Two links <Hyperlink Tag = 'First'>Foo</Hyperlink> and <Hyperlink Tag='Second'>Bar</Hyperlink> are embedded here</TextBlock></StackPanel> Then use following code; I think its from a sample...
Bernt |
|
barobax
Senior Member Joined: 07 May 2008 Status: Offline Points: 117 |
Post Options
Thanks(0)
|
thanks
|
|
(Farsi IS WRONG you must say [PARSI])
|
|
ibmldev
Groupie Joined: 17 October 2006 Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Bernt,
Beautiful! Thanks very much! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |