views:

130

answers:

2

Hello again, A few hours ago I found that it's really easy to display *.rtf document using standart .net 2.0 winforms control (RichTextBox). It's really cool that it can display even pictures, but for me there's one missing feature - hyperlinking. I prepared *.rtf document with a few hyperlinks to paragraphs inside document. Then I put this file into resources and loaded to rtf property of control but unluckly, clicking on links doesn't work. Is there possible a hack or workaround to enable hyperlinks?

A: 

How are your links formatted and is DetectUrl true?

From codeproject -> only links starting with one of the recognized protocols (http:, file:, mailto:, ftp:, https:, gopher:, nntp:, prospero:, telnet:, news:, wais:, outlook:) are recognized and reformatted.

http://www.codeproject.com/KB/edit/RichTextBoxLinks.aspx

http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.detecturls(VS.80).aspx

The microsoft article has an example on the LinkClicked event.

private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
{
   System.Diagnostics.Process.Start(e.LinkText);
}
TEEKAY
A: 

OK, I'll try to describe larger part of needed solution.

My customer will prepare one short document (let's say one *.docx file or one *.html file).

It will contain a few chapters and we want to place small table of contents at the top of document.

The expected behaviour is that user click topic and the control scroll its content to desired place in document.

So maybe it's not about links but about bookmarking.

tomo