Okay this is what I have so far. I have a form that needs to load a file externally and populate the combobox. I can get that part if I use a button, but I don’t want to use a button. I want it to populate when the form loads for the first time. The below code does not accomplish this, it doesn’t even try to load it. I put break points in this code but it never breaks. I am thinking that the combobox isn’t loaded yet and the program doesn’t try.
Any help would be nice.
Private Sub mortCalMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'sets listview values
mortBox.SelectedIndex = 0
Dim rdr As StreamReader = File.OpenText("mortgageTypes.txt")
While Not rdr.EndOfStream
Dim line As String = rdr.ReadLine()
mortBox.Items.Add(line)
End While
rdr.Close()
End Sub
Comment out this line:
You can’t set the index on an empty list.