| 发表于:2007-06-24 21:16:23 楼主 |
procedure tform1.setfocustodoc; begin if webbrowser1.document <> nil then with webbrowser1.application as ioleobject do doverb(oleiverb_uiactivate, nil, webbrowser1, 0, handle, getclientrect); end; 除此之外,我还找到一种更简单的方法,这里一并列出: if webbrowser1.document <> nil then ihtmlwindow2(ihtmldocument2(webbrowser1.document).parentwindow).focus 刚找到了更简单的方法,也许是最简单的: if webbrowser1.document <> nil then ihtmlwindow4(webbrowser1.document).focus 还有,需要判断文档是否获得焦点这样来做: if ihtmlwindow4(webbrowser1.document).hasfocus then 有谁能把这翻译成vb.net啊? |
|
|
|
|