从 VB6 迁移到 .NET,TreeNode.FirstSibling 是否有等效函数?
我正在迁移的桌面应用程序大量使用了 TreeView 控件,并且多次调用 TreeNode.FirstSibling
,例如,
'UPGRADE_ISSUE: MSComctlLib.Node property tvTreeView.SelectedItem.FirstSibling was not upgraded.
If tvTreeView.SelectedNode.FirstSibling.Index = 1 Then
...
End If
是否有等效的函数可供使用?
The desktop application I'm migrating makes heavy use of a TreeView control, and many calls to TreeNode.FirstSibling
, e.g.
'UPGRADE_ISSUE: MSComctlLib.Node property tvTreeView.SelectedItem.FirstSibling was not upgraded.
If tvTreeView.SelectedNode.FirstSibling.Index = 1 Then
...
End If
Is there an equivalent function to use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,有一个兄弟姐妹就必须有一个父母,所以你可以这样做
或者你可以做
编辑:,对于最后一个兄弟姐妹:
Well to have a sibling it has to have a parent, so you could do
Or you could do
EDIT: and for last sibling:
我可能是错的,但不是“FirstChild”或“FirstParent”。 或者,NextNode,它应该迭代兄弟节点。
I could be wrong but isn't "FirstChild", or FirstParent. Alternatively, NextNode, which should iterate through siblings.