TreeNode和TreeNode []之间的差异?(Differences between TreeNode and TreeNode[]?)

我是新手,我无法查看返回的错误TreeNode和TreeNode []之间的区别

"Cannot implicitly convert type 'System.Windows.Forms.TreeNode[]' to'System.Windows.Forms.TreeNode'

I´m a newbie, and I can´t view the difference between TreeNode and TreeNode[] the error that returns is

"Cannot implicitly convert type 'System.Windows.Forms.TreeNode[]' to'System.Windows.Forms.TreeNode'

最满意答案

TreeNode和TreeNode []是不同的。 TreeNode是单个节点,而TreeNode []是TreeNode的数组。

例如:

TreeNode(String, TreeNode[])它是TreeNode的重写构造函数。

public TreeNode( string text, TreeNode[] children )

您无法直接将TreeNode []强制转换为TreeNode,而是通过调用单个直通索引。

TreeNode and TreeNode[] are different. TreeNode is a single Node while TreeNode[] is an Array of TreeNode.

ForExample:

TreeNode(String, TreeNode[]) it is an overridden constructor of TreeNode.

public TreeNode( string text, TreeNode[] children )

You can not directly cast TreeNode[] to TreeNode but via calling a single through index.

TreeNode和TreeNode []之间的差异?(Differences between TreeNode and TreeNode[]?)

我是新手,我无法查看返回的错误TreeNode和TreeNode []之间的区别

"Cannot implicitly convert type 'System.Windows.Forms.TreeNode[]' to'System.Windows.Forms.TreeNode'

I´m a newbie, and I can´t view the difference between TreeNode and TreeNode[] the error that returns is

"Cannot implicitly convert type 'System.Windows.Forms.TreeNode[]' to'System.Windows.Forms.TreeNode'

最满意答案

TreeNode和TreeNode []是不同的。 TreeNode是单个节点,而TreeNode []是TreeNode的数组。

例如:

TreeNode(String, TreeNode[])它是TreeNode的重写构造函数。

public TreeNode( string text, TreeNode[] children )

您无法直接将TreeNode []强制转换为TreeNode,而是通过调用单个直通索引。

TreeNode and TreeNode[] are different. TreeNode is a single Node while TreeNode[] is an Array of TreeNode.

ForExample:

TreeNode(String, TreeNode[]) it is an overridden constructor of TreeNode.

public TreeNode( string text, TreeNode[] children )

You can not directly cast TreeNode[] to TreeNode but via calling a single through index.