Could you give me all relevant code about both the .widescreen array item and the .dvdimage array item?
add button is
If Val(TxtaddRating.Text) > 5 Then
MsgBox("Please enter a number between 1 and 5") 'makes sure the user enters a number equal to or less than 5
Else
If Val(TxtaddRating.Text) < 1 Then
MsgBox("Please enter a number between 1 and 5") 'makes sure the user enters a number equal to or more than 1
Else
numdvds = numdvds + 1 'adds one to numdvds
ReDim Preserve Details(numdvds) 'preserves the data already in the array
With Details(numdvds)
.Title = Txtaddtitle.Text
.Director = TxtaddDirector.Text
.Year = TxtaddYear.Text
.Rating = Val(TxtaddRating.Text)
.dvdimage = OpenFileDialog1.FileName
.widescreen = Chkboxwidescreen.CheckState ' adds all data into each section of the array
End With
when i go to load them from the file its
Dim i As Integer
i = numdvds
Dim inputfile As IO.StreamReader
inputfile = IO.File.OpenText("DVDs.txt") 'opens the file to read from
While Not inputfile.EndOfStream
i = i + 1
ReDim Preserve Details(i) 'preserves the dat already in the array
With Details(i)
.Title = inputfile.ReadLine()
.Director = inputfile.ReadLine()
.Year = inputfile.ReadLine()
.Rating = inputfile.ReadLine()
.dvdimage = inputfile.ReadLine()
.widescreen = inputfile.ReadLine() 'reads in all the lines from the text file into the array
End With
numdvds = i
End While
inputfile.Close()
With Details(0)
TxtTitle.Text = .Title
TxtDirector.Text = .Director
TxtYear.Text = .Year
TxtRating.Text = Ratingstars(.Rating)
PBoximage.ImageLocation = .dvdimage
chkboxwidescreen.Checked = .widescreen 'makes the main form show the information from the first film in the array
End With