请教 关于DELPHI7下第三方EmbeddedWB控件的使用方法

rjzhangjun 2014-04-19 12:57:36
如题:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if timeflag1>=80 then
begin
timeflag1:=0;
Memo1.Text:= '';
EmbeddedWB1.Navigate(edit1.Text);
flashcount:=flashcount+1;
Label1.Caption:='第 ' + trim(inttostr(flashcount)) + ' 次刷新网页完毕。 ';
Timer2.Enabled:=true;
end
else
begin
timeflag1:=timeflag1 + 1;
end;
end;
上述代码 给Label1.caption赋值时机是不正确的,如何才能在网页成功刷新完毕时再运行这句代码呢?
初用DELPHI及该控件,完全不懂他的事件如何写。万望各位大神帮忙,不胜感激。业余,好奇。绝非商业程序员。
96年学该专业,02年毕业并未从事该行业。卖电脑至今。纯爱好,整着玩。再次谢谢大家。
...全文
715 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
rjzhangjun 2014-05-21
  • 打赏
  • 举报
回复
上楼的方法可能解决绝大部份的网页弹新窗口的问题。但是运行这个网页时 不行了。有谁有解?:

rjzhangjun 2014-05-21
  • 打赏
  • 举报
回复
新的问题我又自己解决了: procedure TForm2.EmbeddedWB1NewWindow2(ASender: TObject; var ppDisp: IDispatch; var Cancel: WordBool); begin Cancel:=true; label1.Caption:='弹出新窗口取消'; end; procedure TForm2.EmbeddedWB1NewWindow3(ASender: TObject; var ppDisp: IDispatch; var Cancel: WordBool; dwFlags: Cardinal; const bstrUrlContext, bstrUrl: WideString); var urlstr:string; begin urlstr:=bstrUrl; EmbeddedWB1.Navigate(urlstr); IEAddress1.Text:=urlstr; end;
rjzhangjun 2014-05-20
  • 打赏
  • 举报
回复
这个控件的使用方法真是不好找啊。上面的问题解决了。新的问题又出来了。如果让所有新接都是在当前页面显示呢,当在新页面打开时,他会调用系统默认浏览器。这很不爽,我希望,所有新页面都在我的这个页面打开。
「已注销」 2014-04-19
  • 打赏
  • 举报
回复
EmbeddedWB控件是有OnTitleChange事件的. 当页面刷新时也会触发.
rjzhangjun 2014-04-19
  • 打赏
  • 举报
回复
引用 1 楼 m617105 的回复:
试试处理下 DocumentComplete 事件
我也晓得是要处理这个事件,可是不晓得怎么在DELPHI里定义这个事件。呃, 刚才去捣腾了下,太久没用DELPHI,VB习惯也误导了我,控件属性栏,选事件页,然后在对应事件后输一自定义事件名回车就OK了。呃,问题解决。谢谢。暂时不结贴吧,希望大家能在后面多跟一些这个第三方网页控件的用法。
浩南_哥 2014-04-19
  • 打赏
  • 举报
回复
试试处理下 DocumentComplete 事件
Delphi第三方控件EmbeddedWB,这是一个不错的浏览器控件,比Delphi自带的Webbrowser要强悍 EmbeddedWB安装方法: 1.下载压缩包,飘易下载的是EmbeddedWB v14.67.0版本,下载地址:http://www.delphifans.com/SoftView/SoftView_2705.html。 2.解压整个压缩包到 lib\EmbeddedWB 下; 3.复制 lib\EmbeddedWB 下的Packages目录中的EmbeddedWebBrowser_D2007.dpk(因为飘易使用的是DELPHI2007)到Source目录里; 4.用Delphi7开发环境打开 EmbeddedWebBrowser_D2007.dpk 文件,按Optios按钮,作如下调整: Directories/Conditionals标签Unit Output Dir=“D:\Program Files\CodeGear\RAD Studio\5.0\lib\EmbeddedWB\Source”(具体路径自行决定); 5.按Compile 再按Install; 6.不要保存变化了的dpk文件及压缩包; 7.在具体的编译工程时,需检查该源目录(D:\Program Files\CodeGear\RAD Studio\5.0\lib\EmbeddedWB\Source)在 Delphi IDE 的 "Search Path" 路径里(Project -> Options -> irectories/Conditionals -> Search Path); 如果没有,添加这个源目录路径。否则,在使用控件的时候,出现“File not found: 'SHDocVw_EWB.dcu'” 错误。 8.可以正常使用了。 这里还有一篇别人的“Embedded Web Browser Delphi组件的安装”,不过是把TEmbeddedWB控件安装到 Delphi7 里的。 下面是D2005 installing steps:1.After downloading Unzip the package. 2. Put the folder that contain the package in the path "..:\Borland\BDS\3.0\lib" 3. Open Delphi IDE and press in the menu bar On: File --> "Open" In the open dialog navigate to the path where you store your package to the source folder("..:\Borland\BDS\3.0\lib\EmbeddedWB_D2005\Source"). 5.Choose file name "EmbeddedWebBrowser_D2005.dpk" and press open. 6.In the project manager (in the right corner) point with your mouse on the top file ("EmbeddedWebBrowser_D2005.bdsproj"). Then Right click and choose "Build" 7. And last In the same file & menu Press install. 8. Do not save the package changes. 9. You should make sure that the source folder is in the Delphi IDE "Search Path". If not You must add it.

1,594

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧