Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
conn.Open()
Dim cmb As New ComboBox
Dim tbp As New TabPage
Dim lbl As New Label
Dim dir As New DirectoryInfo("\\server\it\ScriptTest\")
For Each d As DirectoryInfo In dir.GetDirectories
tbp.Name = "tbp" & d.Name
tbp.Location = New System.Drawing.Point(4, 22)
tbp.Padding = New System.Windows.Forms.Padding(3)
tbp.Size = New System.Drawing.Size(281, 187)
tbp.UseVisualStyleBackColor = True
tbp.Text = d.Name
Me.tbcModules.Controls.Add(tbp)
cmb.FormattingEnabled = True
cmb.Location = New System.Drawing.Point(15, 98)
cmb.Name = "cmb" & d.Name
cmb.Size = New System.Drawing.Size(228, 21)
tbp.Controls.Add(cmb)
lbl.AutoSize = True
lbl.Location = New System.Drawing.Point(12, 42)
lbl.Name = "Lbl" & d.Name
lbl.Size = New System.Drawing.Size(219, 13)
lbl.TabIndex = 3
lbl.Text = "Select a job to run from the drop down menu."
tbp.Controls.Add(lbl)
Dim folder As New DirectoryInfo("\\server\it\ScriptTest\" & d.Name)
Dim tmpName As String = ""
Try
For Each f As FileInfo In folder.GetFiles
cmb.Items.Add(f.Name.Replace(".txt", ""))
Next
Catch c As Exception
tbp.Dispose()
End Try
Next
End Sub
|