无法关注webbrowser控件(Access 2010) [英] Unable to get focus off webbrowser control (Access 2010)

查看:103
本文介绍了无法关注webbrowser控件(Access 2010)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这看起来很奇怪。我用pdfs动态填充webbrowser控件。我只是使用控件的ControlSource属性和PDF文件的完整路径,它完全正常。但是,我希望用户能够使用箭头键移动连续的
表单。在当前控件上填充了活动记录的指定PDF。

This seems odd. I'm dynamically populating a webbrowser control with pdfs. I'm just using the control's ControlSource property and the full path to the PDF file, which works perfectly fine. However, I'd like for a user to be able to move through a continous form with the arrow keys. On Current the control is populated with the active record's assigned PDF.

问题是,一旦我设置了webbrowser控件的源,它将获得焦点并且REFUSE让它继续,所以箭头键没用。我已经尝试了几乎所有的东西,以使焦点回到连续形式或其任何控件,但无济于事。
我没有收到任何错误,但重点仍然放在webbrowser控件上。在设置ControlSource和webbrowser的Enter,GotFocus,AfterUpdate,DocumentComplete和KeyDown事件后,我试图立即将重点放回子表单
(如果PDF有焦点,KeyDown甚至不会触发)。什么都行不通。一旦设置了ControlSource并加载了新的PDF,我无法以编程方式将焦点设置在窗体上。

The thing is that once I set the the webbrowser control's source it will get the focus and REFUSE to let it go, so the arrow keys are useless. I have tried almost everything to get the focus back to the continuous form or any of its controls, to no avail. I'm not getting any errors but the focus remains on the webbrowser control. I have tried to give back the focus to the subform immediately after setting the ControlSource and on the webbrowser's Enter, GotFocus, AfterUpdate, DocumentComplete and KeyDown Events (KeyDown doesn't even fire if the PDF has focus anyway). Nothing works. I cannot set the focus to ANYWHERE on the form programmatically once the ControlSource has been set and a new PDF has loaded.

实际上,焦点似乎设置为瞬间但是然后它切换回webbrowser控件。这就像有一个事件触发并触发我无法访问的事件。据我所知,这是加载新PDF时
在webbroswer控件上触发的事件序列:

Actually, it seems that the focus is set for a split second but then it switches back to the webbrowser control. It's like there's one event that fires and triggers this that I have no access to. From what I can tell, this is the sequence of events that fires on the webbroswer control when a new PDF is loaded:

输入

文档完成

更新 

但是"更新后"必须发生一些事情;,因为设置焦点仍然不够,它再次切换回webbrowser。

But something MUST happen after "Updated", because setting the focus there still isn't enough and it once again switches back to the webbrowser.

任何想法?

推荐答案

发布您当前的代码。

Post your On Current code.


这篇关于无法关注webbrowser控件(Access 2010)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆