G
Guest
The following code chunk
static T CreateControl<T>(string name)
where T : new()
{
new T(name);
}
results in Compiler Error CS0417
MSDN help tells that "If you need to call another constructor, consider
using a class type constraint or interface constraint."
Any ideas on how to achieve this?
static T CreateControl<T>(string name)
where T : new()
{
new T(name);
}
results in Compiler Error CS0417
MSDN help tells that "If you need to call another constructor, consider
using a class type constraint or interface constraint."
Any ideas on how to achieve this?