0

I have 3 classes, a student class, a studentList class, and a form. The ToString method is implemented in the student class, and a few students have been created and added in the studentList class.

In the form, I'd like my current list of students to show up in a multiline textbox at application launch. I wasn't sure how to do that, so to test my methods I just called a messageBox to display my students. Here's what my messagebox shows:

WindowsFormApplication.studentList

Any idea why my list isn't being shown correctly?

By the way, here is the ToString method from the student class:

public override string ToString()
        {
            return Crn + "\t" + Subj + "\t" + Crse + "\t" + Sec;
        }
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ddanbe
0

Nevermind, for some reason our professor didn't ask us to include a tostring method in the studentList class as well, so I just added one and it works fine now. If there's a different way to do it please let me know.

0

You can always use the form load event if you want to do something beforehand :private void Form1_Load(object sender, EventArgs e)

{
//do something before other actions
}

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.