I was wondering if someone could help me with my problem. I have some code
that gets document names from a directory; I'm trying to make each document
name into a linklabel. I got the name of the first document to show but each
additional document is not showing.
Dim strDirectory = ConfigurationSe ttings.AppSetti ngs("cad_direct ory")
Dim strFile As String
Dim i As Integer = 0
For Each strFile In Directory.GetFi les(strDirector y) 'get the files
in the directory
If Path.GetExtensi on(strFile).ToL ower = ".doc" Or
Path.GetExtensi on(strFile).ToL ower = ".pdf" Then
Dim strTemp As String = Path.GetFileNam e(strFile)
Dim lnkLabel(i) As LinkLabel
lnkLabel(i) = New System.Windows. Forms.LinkLabel
With lnkLabel(i)
.Name = "lnkLabel_" & (i)
.Text = strTemp
End With
Me.lbdocs.Contr ols.Add(lnkLabe l(i))
End If
i += 1
Next
What am I doing wrong?
--
TC