Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Parse hyperlinks

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 11-26-2006   #1 (permalink)
Jan Kucera
Guest


 

Parse hyperlinks

Hi,
I would like to render a text on a form, but make the http links active. I
know how to find them with Regex, but I have no idea how to make them
clickable...with all text flow capabilities... I think this behaviour is
requested quite often, any hints?
It would be nice if it could be done generally (handle click on any custom
"hot" keywords...) Thanks for ideas.

Jan


My System SpecsSystem Spec
Old 11-27-2006   #2 (permalink)
Douglas Stockwell
Guest


 

Re: Parse hyperlinks

Given your text, you can break it up and build up the following structure:

<TextBlock>
<Run Text="aaa" />
<Hyperlink><Run Text="bbb" /></Hyperlink>
</TextBlock>

TextBlock tb = new TextBlock();
tb.Inlines.Add(new Run("aaa"));
tb.Inlines.Add(new Hyperlink(new Run("bbb"));

See also the NavigateUri property and Click event of the hyperlink.

"Jan Kucera" <kucera@lupacovka.cz> wrote in message
news:B5E8258A-EAA0-4401-9263-7FBF9256CDEC@microsoft.com...
> Hi,
> I would like to render a text on a form, but make the http links active. I
> know how to find them with Regex, but I have no idea how to make them
> clickable...with all text flow capabilities... I think this behaviour is
> requested quite often, any hints?
> It would be nice if it could be done generally (handle click on any
> custom "hot" keywords...) Thanks for ideas.
>
> Jan


My System SpecsSystem Spec
Old 11-27-2006   #3 (permalink)
Douglas Stockwell
Guest


 

Re: Parse hyperlinks

Given your text, you can break it up and build up the following structure:

<TextBlock>
<Run Text="aaa" />
<Hyperlink><Run Text="bbb" /></Hyperlink>
</TextBlock>

TextBlock tb = new TextBlock();
tb.Inlines.Add(new Run("aaa"));
tb.Inlines.Add(new Hyperlink(new Run("bbb"));

See also the NavigateUri property and Click event of the hyperlink.

"Jan Kucera" <kucera@lupacovka.cz> wrote in message
news:B5E8258A-EAA0-4401-9263-7FBF9256CDEC@microsoft.com...
> Hi,
> I would like to render a text on a form, but make the http links active. I
> know how to find them with Regex, but I have no idea how to make them
> clickable...with all text flow capabilities... I think this behaviour is
> requested quite often, any hints?
> It would be nice if it could be done generally (handle click on any
> custom "hot" keywords...) Thanks for ideas.
>
> Jan


My System SpecsSystem Spec
Old 11-27-2006   #4 (permalink)
Jan Kucera
Guest


 

Re: Parse hyperlinks

Well that looks great. Now.. should I take the string, split it to
text/hyperlinks and then add these to the TextBlock, or is there any elegant
way to do this on TextBlock text at once?
Thanks,
Jan

"Douglas Stockwell" <doug@remove.11011.net> wrote in message
news71E0B71-6E31-4D50-A465-4A9A1CEFA8CE@microsoft.com...
> Given your text, you can break it up and build up the following structure:
>
> <TextBlock>
> <Run Text="aaa" />
> <Hyperlink><Run Text="bbb" /></Hyperlink>
> </TextBlock>
>
> TextBlock tb = new TextBlock();
> tb.Inlines.Add(new Run("aaa"));
> tb.Inlines.Add(new Hyperlink(new Run("bbb"));
>
> See also the NavigateUri property and Click event of the hyperlink.
>
> "Jan Kucera" <kucera@lupacovka.cz> wrote in message
> news:B5E8258A-EAA0-4401-9263-7FBF9256CDEC@microsoft.com...
>> Hi,
>> I would like to render a text on a form, but make the http links active.
>> I know how to find them with Regex, but I have no idea how to make them
>> clickable...with all text flow capabilities... I think this behaviour is
>> requested quite often, any hints?
>> It would be nice if it could be done generally (handle click on any
>> custom "hot" keywords...) Thanks for ideas.
>>
>> Jan

>


My System SpecsSystem Spec
Old 11-27-2006   #5 (permalink)
Jan Kucera
Guest


 

Re: Parse hyperlinks

Well that looks great. Now.. should I take the string, split it to
text/hyperlinks and then add these to the TextBlock, or is there any elegant
way to do this on TextBlock text at once?
Thanks,
Jan

"Douglas Stockwell" <doug@remove.11011.net> wrote in message
news71E0B71-6E31-4D50-A465-4A9A1CEFA8CE@microsoft.com...
> Given your text, you can break it up and build up the following structure:
>
> <TextBlock>
> <Run Text="aaa" />
> <Hyperlink><Run Text="bbb" /></Hyperlink>
> </TextBlock>
>
> TextBlock tb = new TextBlock();
> tb.Inlines.Add(new Run("aaa"));
> tb.Inlines.Add(new Hyperlink(new Run("bbb"));
>
> See also the NavigateUri property and Click event of the hyperlink.
>
> "Jan Kucera" <kucera@lupacovka.cz> wrote in message
> news:B5E8258A-EAA0-4401-9263-7FBF9256CDEC@microsoft.com...
>> Hi,
>> I would like to render a text on a form, but make the http links active.
>> I know how to find them with Regex, but I have no idea how to make them
>> clickable...with all text flow capabilities... I think this behaviour is
>> requested quite often, any hints?
>> It would be nice if it could be done generally (handle click on any
>> custom "hot" keywords...) Thanks for ideas.
>>
>> Jan

>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXML 4.0 SP2 Parse and SDK t-4-2 Vista performance & maintenance 0 07-10-2008 12:29 PM
Can Powershell parse email? akcorr PowerShell 4 03-26-2008 01:43 PM
How Powershell parse HTMLDocument? william.wang PowerShell 2 10-07-2007 09:38 PM
Parse XML files from Powershell? Duncan Smith PowerShell 8 03-21-2007 07:31 AM
Using Parse-TextObject J.Marsch PowerShell 6 01-19-2007 08:20 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51