Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# control.parent和control.HasChildren_C#_Parent - Fatal编程技术网

C# control.parent和control.HasChildren

C# control.parent和control.HasChildren,c#,parent,C#,Parent,我正在浏览一些c代码,看到了像eg这样的代码 if (c.HasChildren) 谁能告诉我它们是什么?它们有什么用 谢谢,c是某种类型的gui组件。它询问控件内是否有控件(hasChildren) 然后询问c所在的控件是否为数字上下控件。(c控件的父控件)c是页面的可视元素,是逻辑构建的 您将拥有您的主窗体。 此表单将有多个面板或控件作为子项,一直到按钮和标签 因此,如果执行.haschilds操作,只需检查控件中是否包含任何元素。可能是在动态添加它们时 .Parent是获取当前文件的包

我正在浏览一些c代码,看到了像eg这样的代码

if (c.HasChildren)

谁能告诉我它们是什么?它们有什么用


谢谢,c是某种类型的gui组件。它询问控件内是否有控件(hasChildren)


然后询问
c
所在的控件是否为数字上下控件。(c控件的父控件)

c是页面的可视元素,是逻辑构建的

您将拥有您的主窗体。
此表单将有多个面板或控件作为子项,一直到按钮和标签

因此,如果执行
.haschilds
操作,只需检查控件中是否包含任何元素。可能是在动态添加它们时


.Parent
是获取当前文件的包含控件的方法。它允许您询问或修改它的属性。

什么是
c
?可能是控制?那个代码是纯英语的。。。我想他们的意思很明显:)
if(c.haschilds)
告诉你
c
是否有孩子。和
if(c.parent是NumericUpDown)
告诉您
c
的父项是否属于
NumericUpDow类型
谢谢您的帮助:)
if (c.parent is NumericUpDown)