问题
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
回答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.
来源:https://stackoverflow.com/questions/13605557/retrieving-selected-text-from-webbrowser-control-in-windows-phone-7