Is their any way to highlight word in text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramsham
    New Member
    • Feb 2010
    • 10

    Is their any way to highlight word in text

    Hi

    I want to search a particular word from text and if found match in between then highlight that word where ever it appears.Then if user clicks on that word it shows some information related to that word.

    1:Like if i want to search word "then" in above text then it must show as:

    I want to search a particular word from text and if found match in between then highlight that word where ever it appears.Then if user clicks on that word it shows some information related to that word.
    2:After that if mouse pointer moves(Or mouse click) their then it shows some more information about that word.
    Like that words meaning .
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    if you're searching inside a textbox then TextBox.Find() will do and select the supplied word...

    otherwise you can use regex if you want to get the location of the searched word

    Comment

    • ramsham
      New Member
      • Feb 2010
      • 10

      #3
      Originally posted by ThatThatGuy
      if you're searching inside a textbox then TextBox.Find() will do and select the supplied word...

      otherwise you can use regex if you want to get the location of the searched word
      but how could i find it on web page is it require to go back to database then search from it and if match found then show it on highlighted on page,then if user click on that highlighted word then it must show some more information related to that word from database.

      can you give me some function code that you are saying.

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Originally posted by Original Poster
        Can anybody send me code to [...]
        The Bytes volunteers are not here to write your code for you. This is not a free homework service.
        Bytes is very much a "Give me a fish I eat for a day. Teach me to fish I eat for a lifetime" kind of place. Just giving you the code doesn't help you learn near as effectively as good old-fashioned trial and error.

        Do a little reading up and experimenting then if your trials aren't doing what you expect, post the code and relevant messages/errors and we'll see what we can do to point you in the right direction for making it work.

        Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.

        May I suggest
        • First: Do some research. I heard about thing thing called Google, or books even.
        • Second: Do some experiments yourself. You will learn so much from actually trying it before throwing up your hands in defeat before even starting.
        • Third: Show the volunteers here the code that you created that was the closest to successful along with relevant errors.

        Comment

        Working...