Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a MDI application with one window as a web browser and the other as a text editor. When I copy text over , it stores the URL.

 

Is there a way that when I click on the URL later, it will take me to the webpage, but with the text that was highlighted previously that was copied, remaining highlighted. So if a webpage contains the text "hello world" and i copied it over and i go back to it, the hello world should still be highlighted?

 

If possible using different colours for different highlighted text but thats an optional extra

 

I found the following bits of code of google groups but I coulndt understand how to use them:

 

mshtml.IHTMLDocument2 HTMLDocument;

HTMLDocument htmlDocument = (mshtml.IHTMLDocument2) browserComp.Document;

mySelection = htmlDocument.selection.ToString();

this.myTextRange = (mshtml.IHTMLTxtRange)mySelection.createRange();

myText = myTextRange.text;

 

 

AND I found this:

 

IHTMLTxtRange range = (IHTMLTxtRange)

dhtmlEditor.DOM.selection.createRange();

String highlighted = range.text;

 

 

As you can see I am currently using the axwebbrowser component, however I know c# express has the new WebBrowser component so if its easier to do it in that, I am willing to use that if anybody know the code.

 

Thank you for any help you can provide.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...