本文整理自网络,侵删。
设置焦点 (当Webbrowser处于编辑模式) TWebBrowser非常特殊,它从TWinControl继承来的SetFocus方法并不能使得它所包含的文档获得焦点//方法1procedure TForm1.ToolButton1Click(Sender: TObject);begin if Form1.WebBrowser1.Document <> nil then with WebBrowser1.Application as IOleobject do DoVerb(OLEIVERB_UIACTIVATE, nil, WebBrowser1, 0, Handle, GetClientRect());end; //方法2 Form1OnCreate事件无效if WebBrowser1.Document <> nil then IHTMLWindow2(IHTMLDocument2(WebBrowser1.Document).ParentWindow).Focus();
相关阅读 >>
Delphi xe7 android通过配置实现splash功能
Delphi winapi: getclassname - 获取指定窗口的类名
Delphi xe6 取得app自己的版本号(横跨4个平台)
Delphi win32_diskdrive 硬盘 参数说明
更多相关阅读请进入《Delphi》频道 >>