Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RichTextBox and Links

Status
Not open for further replies.

Troy28M

Programmer
Jan 24, 2005
24
0
0
US
I need to create a RichTextBox, unless there is a better method that will have links within, among other things. I am having issues with a few items. My links will not be in Link Form ( file:, ...), they will be arbitrary. So, is there a way to create a link in a RTB wihtout the AutoDetect?

Other Questions:

- Instead of links, I am thinking about changing the backcolor and reading the area a person clicks in the RTB and handling what action to do based on the text, although I have no idea how to do this...Possible? I'm guessing I will need to use a Click event but not sure how to read whether it has a different backcolor.

- Is it possible, if so how, to allow a user to tab through a populated RTB and have the cursor only stop at the links/different backcolor items? Using KeyPress event maybe? But once again would need to be able to read the RTB to jump the cursor to the next backcolor difference.

Thanks in advance.
 
All formatting in a RTB is done through specific tags. Sort of like HTML or XML. To do it visually all you have to do is decided how you want to represent it then wrap that bit of text in the right tags. The problem is it has to be unique enough that when you are reading it back out you can differentiate between your link and something that has just been formatted to look like your link. At the end of the day something like that would require you to write your own RichTextBox.

All I can do is point you here http://msdn.microsoft.com/en-us/library/aa140277.aspx. That has all the information on the Rich Text format.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top