![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| parse files | VB Script | |||
| MSXML 4.0 SP2 Parse and SDK | Vista performance & maintenance | |||
| Can Powershell parse email? | PowerShell | |||
| Parse XML files from Powershell? | PowerShell | |||
| Using Parse-TextObject | PowerShell | |||