10
Answers

How to highlight selected text in web browser in win form

Aisha Srivastava

Aisha Srivastava

10y
2.7k
1
//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)