Firemonkey TWebBrowser input alternative?

北战南征 提交于 2019-12-04 07:15:54

The trick is give the focus to the WebBrowser component:

procedure TFormBrowserAdd.ButtonNavigateClick(Sender: TObject);
begin
  WebBrowser.CanFocus := True;
  WebBrowser.Navigate(EditUrl.Text);
  WebBrowser.SetFocus;
end;

But, after that the back key will not work correctly so you have to manage in other way. For example i have used a button on my form.

you have to set foucs on web browser on end of loading page

procedure TfrmMain.BrowserDidFinishLoad(ASender: TObject);
begin
Browser.CanFocus := True;
Browser.SetFocus;
end;

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