Hello everyone!

I'm working on a school project where I need to make a GPA calculator. I have a user control for classes and another for the type of program you are in. I'm having trouble getting an array of user controls to work mostly probably because I don't think I have the correct syntax for it. I tried doing this for the array but don't think it's right.

Dim Courses() As Course = {Courses1, Courses2, Courses3, Courses4, Courses5, Courses6}

Where Course is my user control, and courses1-6 are on my second user control CourseTab.

When I tried to run and debug my code, it tells me that the array is empty.

Try this:

Dim lstCourses As New List(Of Course)

This will create a list, you can add and remove elements like this:

lstCourses.Add(Courses1)
lstCourses.Remove(Courses1)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.