Ok be easy on me, this is simple for most, but I'm having trouble.
I created a simple (for now) custom object:
VB Code:
Public Class Form1 Dim AllPartFiles As List(Of Part) . . . Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '**NEED HELP HERE** End Sub . . . End Class '[Form1] Public Class Part Public Shared FullFilePath As String Public Shared Part Number as Integer Public Shared Description as String End Class '[Part]
As I search a folder for files, it returns FilePath as a string for each file in the folder, then assigns a new Part.FullFilePath to the current returned FilePath, then add the Part to AllPartFiles list. So I can retrieve each Part from AllPartFiles later. But everything I try doesnt work.
I know below is wrong, but might show what Im trying to do:
VB Code:
Dim Files() As String Files = System.IO.Directory.GetFiles(RootFolder, "*.ipt") Dim k As String For Each k In Files Part.FullFilePath = k AllPartFiles.Add(New Part) Next Dim j As Part For Each j In AllPartFiles MsgBox(j.Count) Next
So how would you do this? Create a New Part, change its values, and then add it to AllPartFiles list for later, then repeat?




Reply With Quote