I am using a windows forms RichTextEditBox. I load a RTF file into the control. I then set the following code.
int indexToText = rteb.Find("here");
LinkLabel link = new LinkLabel();
link.Text = "here";
link.LinkBehavior = LinkBehavior.AlwaysUnderline;
link.LinkClicked += new
LinkLabelLinkClickedEventHandler(this.link_LinkClicked);
LinkLabel.Link data = new LinkLabel.Link();
data.LinkData = "Sending Report Results to Multiple Recipients.pdf";
link.Links.Add(data);
link.AutoSize = true;
link.Location = rteb.GetPositionFromCharIndex(indexToText);
link.Height = 40;
link.Width = 60;
link.ForeColor = Color.Blue;
rteb.Controls.Add(link);
when the app is run, the word "here" is in blue, but I don't get an underline and when I try clicking on the word, my click event doesn't fire off. What am I missing here?
To set an underlined link area in
LinkLabelyou should setLinkAreaproperty to the range which should be shown as link, for example: