After looking around for a bit, I am not sure that this is even possible with the built in .NET functions. If it was, there would be, (logically anyway), a SelectedText function in the webBrowser class, (which there is not).
Do some searching on MSDN, CodeProject and CodeGuru to see if you can come up with anything.
.NET Web Browser Control: How to check if there is text selected??
jwagner20
ckoest
actually, you don't even have to go to that trouble.
browser.Document.DomDocument.selection.type will return a string:
"None" if there is no selection and "Text" et. al. if something is selected.
coln
something like this, but i'd urge you to look up the documentation on MSDN:
IHTMLDocument2 doc = webBrowser1.Document.DomDocument as IHTMLDocument2;
IHTMLTxtRange range = doc.selection.createRange() as IHTMLTxtRange;
range.findText("texttofind", 0, 0);
========
you should look up the valid param values on msdn.
but something like this should work.
BTW - don't forget to mark posts as the answer if they answered your question
DanUp
Do some searching on MSDN, CodeProject and CodeGuru to see if you can come up with anything.
startlet
you'll have to use the active x stuff to get to this functionality.
you'll have to add a reference to MSHTML in your project.
this is under the 'Add Reference->COM' tab, under 'Microsoft Html Object Library'.
that should do the trick.
MarilynJ
OK - webBrowser1.Document. What do I use to check if there is text selected
Matt
Jing-ta
Is there anyway possible to code a Find feature
Matt