views:

15

answers:

1

I have a form that displays HTML through a WinForms browser control. I wish to implement search for the contents of the browser. The requirements are:

  • One should be able to search for one or more terms
  • Each hit in the text should be colored e.g. in red
  • Navigation should be provided so that one can easily move from one search hit to the next (e.g. there could be anchors placed on each hit)

Any suggestions on how to best implement this?

A: 

Regex is your friend in these scenarios, a couple of the open source regex viewers have this kind of functionality, have a look at http://www.sellsbrothers.com/tools/ you could have a look at how they have implemented it.

DarenFox