![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) |
| 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 Specs![]() |
| | #4 (permalink) |
| 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 news 71E0B71-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 Specs![]() |
| | #5 (permalink) |
| 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 news 71E0B71-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 Specs![]() |
![]() |
| 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 |