Strings with hyperlinks
-
How can i create a long string with a hyperlink(different colored text) in the middle of the string and draw it to the form? I am trying to make it so that when I write the string I can set the link with a key word.. eg... String = "This is my string, so click here". can anybody help? Mark Thibodeaux
-
How can i create a long string with a hyperlink(different colored text) in the middle of the string and draw it to the form? I am trying to make it so that when I write the string I can set the link with a key word.. eg... String = "This is my string, so click here". can anybody help? Mark Thibodeaux
Try using a LinkLabel control. You can setup this control to show both normal text and a link. It can even display multiple links within its text. But you can't add the link from the designer. It must be done in code.
myLink.Text = "This is my string, so click here" Const linkString As String = "here" myLink.Links.Add(myLink.Text.IndexOf(linkString), linkString.Length)
-- modified at 20:54 Monday 16th January, 2006 Let me rephrase this a little. The text you enter into a LinkLabel in the form designer will become one big link, which is not what you want. If you want to embed a link within normal text, then you must do this via code as shown above. -
Try using a LinkLabel control. You can setup this control to show both normal text and a link. It can even display multiple links within its text. But you can't add the link from the designer. It must be done in code.
myLink.Text = "This is my string, so click here" Const linkString As String = "here" myLink.Links.Add(myLink.Text.IndexOf(linkString), linkString.Length)
-- modified at 20:54 Monday 16th January, 2006 Let me rephrase this a little. The text you enter into a LinkLabel in the form designer will become one big link, which is not what you want. If you want to embed a link within normal text, then you must do this via code as shown above.Thanks that works. One little question, I have seen a few balloon tooltips that are floating out there, how do they make it where all you have to do is write your string and wrap the word or words that you want to be a link with their tag (similar to html). Just wondering. Thank you, Mark Mark Thibodeaux
-
Thanks that works. One little question, I have seen a few balloon tooltips that are floating out there, how do they make it where all you have to do is write your string and wrap the word or words that you want to be a link with their tag (similar to html). Just wondering. Thank you, Mark Mark Thibodeaux
The standard tooltip control can't display links in it. You may have to use a 3rd party control or make your own.