【发布时间】:2014-02-11 20:58:10
【问题描述】:
通过以下代码,我将列表框中的文件列表添加到树视图中。我想为每个添加的节点添加一个包含其文件扩展名的标签。
我已经搜索了一整天,我无法弄清楚如何将标签添加到树节点
Dim Copy2 = aMailbox & tvProgress.SelectedNode.Parent.Text & "\" & tvProgress.SelectedNode.Text & "\" & lstRequired.Text
Dim Copy1 = rPath & lstRequired.Text
If File.Exists(Copy2) Then
MsgBox("File already added. Please edit from the view above", MsgBoxStyle.OkOnly)
Exit Sub
End If
If lstRequired.Text = "Add Additional Requirement" Then
ReportSelect.Show()
Exit Sub
End If
If File.Exists(Copy1) Then
File.Copy(Copy1, Copy2)
tvProgress.SelectedNode.Nodes.Add(lstRequired.Text)
tvProgress.ImageIndex = 0
Else
MsgBox("This file no longer exists in your Lynx Repository. Please select another", MsgBoxStyle.OkOnly, "Lynx Control Panel")
Exit Sub
End If
End Sub
任何建议
谢谢
【问题讨论】: