在mdi父窗体中使用Web浏览器时出现问题(子窗体未显示) [英] Problem While Using Web Browser in mdi parent form(Child Forms Not Displaying)

查看:73
本文介绍了在mdi父窗体中使用Web浏览器时出现问题(子窗体未显示)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



在我的应用程序中,我设计了一个Mdi父表格,其中包含 MenuStrip,toolStrip 和一个将Dock属性设置为'FILL'的Web浏览器



在菜单上单击我显示子表单,但是因为我在Mdi Parent Form上添加了一个Web浏览器....子窗体没有显示。我尝试了网页浏览器的发送回来属性,但它无法正常工作。



我必须显示一个HTML页面在我的Mdi父窗体(主菜单屏幕)中,我必须在HTML页面的顶部显示子窗体。



怎么办????

请帮忙.....

Hello,

In my application i have designed a Mdi Parent Form Which Include a MenuStrip, toolStrip and a Web Browser which have dock property set to 'FILL'

On menu click i am showing child forms,But as i have added a web browser on Mdi Parent Form.... the Child Forms are not displaying.I tried 'Send to Back' property of web browser but it not working.

I have to display a HTML page in my Mdi Parent Form(Main Menu Screen) and i have to display child forms on the top of the HTML page.

What to Do????
Please Help.....

推荐答案

你可以做的是将webbrowser移动到另一个表单用dock填充。将该表单的边框样式设置为无。现在在mdi父加载事件显示此表单调整大小到父窗体的客户区域。将此表单对象保存在全局变量中,因为我们可能需要在resize事件形式中使用此实例。在高度,您可能需要减去工具栏和菜单栏的高度。该位置将为0,toolstrip bootom。也可以在表单resize事件中执行相同的操作。将它设置为始终发送回来。



希望此解决方法有所帮助。
What you may do is move the webbrowser to another form with dock to fill. Set that form's border style to none. Now at the mdi parent load event show this form resized to the client area of the parent form. Keep this forms object in a global variable as we may need this instance in the form resize event. At the height you may need to subtract the height of the toolbar and menu bar. The location would be 0,toolstrip bootom. Do the same at the form resize event as well. Set it to send to back always.

Hope this workaround helps.


您可能要调用webbrowser对象的sendToBack方法当你调用表单和表单被关闭然后调用form_closed事件获取表单的mdiparent属性时,事实上,可以调用webbrowser对象的bringToFront方法。
You maybe to do call sendToBack method of webbrowser object when you call to the forms and when the forms being closed then call to form_closed event for get mdiparent property of the form, in fact, there can be call bringToFront method of webbrowser object.


这篇关于在mdi父窗体中使用Web浏览器时出现问题(子窗体未显示)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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