Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 TreeView 中选择一个节点时,是否有可能作为回报,我将获得从父节点到选定子节点的物理路径?像'~/ParentNode1/ParentNOde2/SelectedChildNode'
对于 ASP.net,使用ValuePathSelectedNode 的属性
ValuePath
对于 Windows 窗体,FullPath使用SelectedNode
FullPath
SelectedNode
注意:FullPath 属性将使用 TreeView.PathSeparator 属性来决定用什么来分隔节点。默认字符是'\'
我明白了,TreeView1.SelectedNode.ValuePath.ToString()