Aisha Srivastava

Aisha Srivastava

  • NA
  • 230
  • 27.2k

How to highlight selected text in web browser in win form

Jan 8 2015 5:44 AM
//Highlight selected Text
// Problem-I have current selection method but could not highlight the current selection..
Please help me out...really stuck....
If need any correction in given code please make it...
 
public void highlightselectedtext()
{
IHTMLDocument2 htmldocument = editorWebBrowser.Document.DomDocument as IHTMLDocument2;
IHTMLSelectionObject currentSelection = htmldocument.selection;
if (currentSelection != null)
{
IHTMLTxtRange range = currentSelection.createRange() as IHTMLTxtRange;
if (range != null)
{
// ?????????//
}
}
 
 
 
Thanks in advance...Plz Help .. 

Answers (10)