Tag Archives: override ToString

Override ToString to allow controls such as ListBox to display objects in C#

All classes inherit the ToString method from the Object ancestor class. Controls such as ComboBox and ListBox use the ToString methods of the objects they contain to decide what to display. By default, ToString returns a class’s name, which is … Continue reading

Posted in classes, OOP, strings, syntax | Tagged , , , , , , , , , , , , , | 4 Comments