2

I am trying to Retrieve selected text from Webbrowser control in Windows phone 7 when it is selected using Tap. Also want to remove the Copy icon when you select the Text.

When on Hold Tapping I want to confirm that webbrowser control has any selected text. How could i place a check there.

Also i want to Highlight the Selected Text in Webbrowser Control.

So problem here is to identify the start and stop of Selected text.

I appreciate any help or resources regarding this.

Thanks

ovais
  • 339
  • 2
  • 13
  • 1
    Do you use specific js framework? The following may help with getting selected text http://stackoverflow.com/questions/5643635/how-to-get-selected-html-text-with-javascript. To remove Copy icon try to unfocus selection. – Sergei Grebnov Nov 28 '12 at 16:19

1 Answers1

1

By Calling

function GetSelectedText() {
       window.external.Notify(document.selection.createRange().htmlText);           
    }

and Adding

Browser.ScriptNotify += new EventHandler<NotifyEventArgs>(Browser_ScriptNotify);

......
void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
  if(e.Value != null)
     MessageBox.Show(e.Value);
}

Solve it for me. Thanx @Sergei Grebnov for you Guidance.

ovais
  • 339
  • 2
  • 13
  • There's a great article in Jeff Blankenburg's that explains the solution of this problem step by step (together with source code) http://www.jeffblankenburg.com/2010/10/18/31-days-of-windows-phone-day-18-webbrowser-control/ – Radoslaw Jun 14 '13 at 08:10