displaying text and make words clcik-able.

dimmu

Member
Joined
May 28, 2009
Messages
9
Programming Experience
Beginner
Hello folk,

actually i want to make a small program which displays a text, and the words of this text are clickable, i mean when i click on a word i want to display some explanations to it (for example in the "HELP" of any software there is text and some words which are URL to other pages on the help) i want the same structure except that instead of URLs i want to display some text when clicking on a word.

so my question is :
is there a control for this kind of use ??

thank you for your help.
 
Not sure if I understand completely, but you can make a label and handle your code in it's click event. If you mean a line of text where each word is clickable and diff from the other's, I am not sure how you could do that.
 
OK you got me curious if you could select a word out of a sentence, so I got this, but your task is to finish it by protecting it from going too low or too high - will cause an error obviously. Make a click event for a textbox and add this code:
VB.NET:
Dim i As Integer = textbox1.SelectionStart
Do Until textbox1.SelectedText = " "
   i -= 1
   textbox1.Select(i,1)
Loop
textbox1.SelectionStart = i + 1
textbox1.Select(i + 1,1)
Dim ii As Integer = i + 1
Do Until textbox1.SelectedText = " "
   ii += 1
   textbox1.Select(ii,1)
Loop
textbox1.SelectionStart = i + 1
textbox1.SelectionLength = ii - (i + 1)
'you now have the text of the word you clicked on so do something with it
:cool:
 
Last edited:
You can create hypertext documents and display them in a WebBrowser control in form. Same source can also be compiled to the common [ame="http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help"]chm[/ame] help file format with various help authoring tools, this can also be integrated with the Forms help system. How to: Provide Help in a Windows Application
 
Back
Top