I have a public abstract class Client
with two inheriting classes Customer
and TimeWaster
.
I created a drop-down menu on a C# Windows Forms
that I would like to show these two class names as options: Customer & TimeWaster.
All I can think of is to create a simple List
that contains these two terms, and then bind the list to the combobox DataSource
:
List<string> clientType = new List<string>()
{
"Customer",
"TimeWaster"
};
public frmClientScreen()
{
cmboxClientType.DataSource = clientType;
}
But this is not maintainable, because in the future I might add many other classes whose names I would like to be displayed in the drop-down menu.
How do I link the class names in my Visual Studio Solution
to the items displayed by the combobox?