我们如何在Windows Appliocations中的Panel中加载WinForm [英] how can we Load WinForm inside of Panel in windows Appliocations

查看:60
本文介绍了我们如何在Windows Appliocations中的Panel中加载WinForm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想在面板内加载一个winForm !!!

是可能的吗?!或者不是......



你知道在asp.net我们可以和JQuery一起加载网页

就像



 $(  #Container)。load(  / SomeDirectory / A.aspx); 



我希望在winapp中得到类似的东西!!!

解决方案

#Container)。load( /SomeDirectory/A.aspx);



我希望在winapp中得到像这样的东西!


首先,表单和其他控件之间的父子关系有意地部分失效:表单可以是非表单控件的父级,而不是相反。如果您为 Form.TopLevel 指定false,则可以删除此限制,但是 - 从不这样做;这没有道理。表格将显示在面板内,包含所有非客户区域(如果有的话),非常丑陋。你真的不需要它。



相反,您可以正确设计表单。如果您描述了哪些功能可以引导您达到如此奇怪的设计思想,您可能会得到更充分设计的建议。



与jQuery示例的类比是不完整的。控件表单在此库中是特殊的。在Web应用程序中,主窗体是浏览器窗口,您永远不会触摸。



-SA

很容易这样做,例如,如果你想在表格2的面板上加载表格3,你只需要在表格3中放置一个带有公共修饰符的面板,然后放入所有控件在表单2中,您通过这种方式调用表单

 Form3 f3 =  new  Form3(); 
f3.panel1.Parent = panel2; // panel1是form3中的公共面板,panel2是您要在
f3.Show();


Hi every one ,, i want to Load a winForm inside of panel !!!
is that possible ?! Or not ...

you know in asp.net we can load web pages together with JQuery
like

$("#Container").load("/SomeDirectory/A.aspx");


and i want to implimment somthing like that in winapp !!!

解决方案

("#Container").load("/SomeDirectory/A.aspx");


and i want to implimment somthing like that in winapp !!!


First of all, parent-child relationship between form and other controls is intentionally rendered partially defunct: a form can be a parent of a non-form control, not the opposite. This limitation can be removed is you assign false to Form.TopLevel, but — never do it; it makes no sense. The form will be shown inside the panel with all its non-client areas (if any), in all the ugliness. You never really need it.

Instead, you can design your form properly. If you describe what functionality leads you to such weird design ideas, you might get an advice of more adequate design.

The analogy with your jQuery example is incomplete. The control Form is special in this library. In a Web application, the "main form" is the Browser window, which you never "touch".

—SA


Its easy to do so, for example if you want to load form 3 at a panel in form 2 all you have to do is to put a panel with public modifier in form 3 then put all your controls and in form 2 you call the form 3 this way

Form3 f3=new Form3();
f3.panel1.Parent=panel2;        //panel1 is the public panel in form3 and panel2 is the panel in form2 you want to load your form in
f3.Show();


这篇关于我们如何在Windows Appliocations中的Panel中加载WinForm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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