所有者vs Parent与ParentForm [英] Owner vs Parent vs ParentForm

查看:114
本文介绍了所有者vs Parent与ParentForm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这三者有什么区别?

What''s the difference in these three?

推荐答案

Tom,

|这三个有什么区别?

|所有者vs父母vs ParentForm


Form.Owner - 表格是否拥有这个表格。例如,一个无模式的

查找/替换对话框将由记事本的主窗口拥有。如果你最小化主表格,那么拥有的表格将最小化,如果你恢复主表格,

所拥有的表格将恢复...通常用于工具 ; SDI中的窗口

应用程序......


Control.Parent - 是否可以立即控制此控件。

例如,放置在Panel或GroupBox中的选项按钮将具有

Panel或GroupBox作为其Parent。


ContainerControl.ParentForm - 是这个表单ContainerControl最终放在了
,但是ContainerControl的Parent可能是另一个ContainerControl的
另一个ContainerControl,它可能有另一个Control作为它的Parent,

然后可能是一个表格。基本上这是一个Control.Parent直到它

找到一个继承自Form的类型。


希望这有助于

Jay


汤姆W <二********** @ nospam.com>在留言中写道

news:%2 **************** @ TK2MSFTNGP12.phx.gbl ...

|这三者有什么区别?
Tom,
| What''s the difference in these three?
| Owner vs Parent vs ParentForm

Form.Owner - Is the Form that "owns" this form. For example a modless
Find/Replace dialog would be Owned by Notepad''s main window. If you minimize
the main Form, the owned form will minimize, if you restore the main form,
the owned form will restore... Normally used for "tool" windows in SDI
applications...

Control.Parent - Is the immediate control that this control is placed on.
For example an option button placed in a Panel or GroupBox would have that
Panel or GroupBox as its Parent.

ContainerControl.ParentForm - is the Form that this ContainerControl is
ultimately placed on, however the Parent of the ContainerControl maybe
another ContainerControl, which may have another Control as its Parent,
which may then be a Form. Basically this does a Control.Parent until it
finds a type that inherits from Form.

Hope this helps
Jay

"Tom W" <di**********@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
| What''s the difference in these three?


Tom,


dim frm as myform

frm.owner = me


在myform中你可以说

me.owner.textbox1或者其他什么


me.ismidicontainer = true

frm.parent = me

我在其中包含一个零或多个孩子的集合

mdichildscollection


me.parentform.menu1''以mdi形式显示mdicontainer上的菜单


我希望这会有所帮助,


Cor

" Tom W" <二********** @ nospam.com> schreef在bericht

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Tom,

dim frm as myform
frm.owner = me

In the myform you can say
me.owner.textbox1 or whatever

me.ismidicontainer = true
frm.parent = me
me contains a than a colection of zero or more childs in its
mdichildscollection

me.parentform.menu1 ''in a mdi form a menu on the mdicontainer

I hope this helps,

Cor
"Tom W" <di**********@nospam.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
什么'这三者有什么不同?
What''s the difference in these three?



Cor,

| me.ismidicontainer = true

| frm.parent = me

|我的

|中包含零个或多个孩子的集合mdichildscollection

您的示例似乎是Form.MdiParent而不是Control.Parent。


希望这会有所帮助

Jay

" Cor Ligthert [MVP]" <无************ @ planet.nl>在消息中写道

新闻:e3 ************** @ TK2MSFTNGP12.phx.gbl ...

|汤姆,

|

| dim frm as myform

| frm.owner = me

|

|在myform中你可以说

| me.owner.textbox1或者其他什么

|

| me.ismidicontainer = true

| frm.parent = me

|我的

|中包含零个或多个孩子的集合mdichildscollection

|

| me.parentform.menu1''以mdi形式在mdicontainer上的菜单

|

|我希望这有帮助,

|

| Cor

|

|

| 汤姆W <二********** @ nospam.com> schreef in bericht

|新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...

| >这三者有什么区别?

|

|
Cor,
| me.ismidicontainer = true
| frm.parent = me
| me contains a than a colection of zero or more childs in its
| mdichildscollection
Your example appears to be Form.MdiParent and not Control.Parent.

Hope this helps
Jay

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:e3**************@TK2MSFTNGP12.phx.gbl...
| Tom,
|
| dim frm as myform
| frm.owner = me
|
| In the myform you can say
| me.owner.textbox1 or whatever
|
| me.ismidicontainer = true
| frm.parent = me
| me contains a than a colection of zero or more childs in its
| mdichildscollection
|
| me.parentform.menu1 ''in a mdi form a menu on the mdicontainer
|
| I hope this helps,
|
| Cor
|
|
| "Tom W" <di**********@nospam.com> schreef in bericht
| news:%2****************@TK2MSFTNGP12.phx.gbl...
| > What''s the difference in these three?
|
|


这篇关于所有者vs Parent与ParentForm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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