C#C
C#3y ago
Calen

WinForms Course Registration/Validation Homework

I just started my C# class for college and I've been having a real tough time trying to get my WinForms Course registration project to work. With this assignment, the only code I needed to write was the code under the courseComboBox_SelectedIndexChanged method and the code under the private void completeRegistrationButton_Click(object sender, EventArgs e) method. I included the validation in the first method but I'm not sure if that needs to be its own file or not. I've inserted the code needed for the courseComboBox_SelectedIndexChanged so it can handle the selection of the courses in the comboBox by validating the selection and adding the course number to the list of registered courses in the ListBox. I've also written the code for the button's event handler method so that when the user clicks the button to submit the completed registration, the program writes the list of registered courses to the output file. Visual Studio says I have no issues but when I run my code, it throws an issue as shown in the last picture. Also when I run the program, the form does not store the classes that I select and I am not able to progress so I'm not sure if that's the courseComboBox_SelectedIndexChanged method acting up or where I'm messing up. For reference, I am referencing the courses project in my WinForms project. This is my first time really submitting anything programming related anywhere so I apologize if I miss some key details I'm trying to insert everything I can think of. I am also really fresh in the programming world so I'm still in the basics. I'd appreciate any help with this, I don't want someone to do it for me, but rather help me find the solution so I can learn what I did wrong and what I'm missing. Thank you.
winforms_1.PNG
winforms_2.PNG
winforms_3.PNG
winforms_4.PNG
winforms_5.PNG
winforms_6.PNG
winforms_error.PNG
Was this page helpful?
WinForms Course Registration/Validation Homework - C#