I use a Height for all the Foos members. Like this
public class Foo<T>
{
public static int FoosHeight;
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Foo<???>.FoosHeight = 50; // DO I Set "object" here?
}
}
The same situation is in VB.NET.
You’d have to put some generic type parameter in there. That being said, I’ll sometimes use some kind of inheritance scheme to get this functionality without having to put in the generic type parameter.
That being said, this will keep the same FoosHeight regardless of the generic type parameter passed into
Foo<T>. If you want a different value for each version ofFoo<T>, you’ll have to pick a type to put in that type parameter, and forget the inheritance scheme.