Retrieving Selected Text from Webbrowser control in Windows phone 7

和自甴很熟 提交于 2019-12-10 10:57:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!