When adding an object in a comboBox and checking it, the full name of the class is displayed according to Microsoft conventions: NomeDaEmpresa.NomeDoProjeto.ModuloDoSistema
.
How do I make only the class name appear?
When adding an object in a comboBox and checking it, the full name of the class is displayed according to Microsoft conventions: NomeDaEmpresa.NomeDoProjeto.ModuloDoSistema
.
How do I make only the class name appear?
By default, this is returned by the ToString()
method, which, if not overridden, returns the distinguished name of the class.
Override the ToString()
method, of the class you are inserting into the ComboBox, to return only the name of it:
public class Myclass
{
.....
.....
public override string ToString() => GetType().Name;
}