I've created a subclass of a button including another class:
Problem is, when I add a MyButton to a form, the designer lets me access (set) MyProp->MyProperty1. In the designer the MyButton control is responding correct to the setting of the property.
But no code is generated, so the properties are lost at runtime. Btw, this is about VS2005, not the Beta.
What requirement am I missing ?
Marcel
Code:
public class MyProperties : System.ComponentModel.Components
{
public bool MyProperty1
{
get { ... }
set { ... }
}
}
public class MyButton : Button
{
private MyProperties myProperties;
public MyProperties MyProp
{
get { return myProperties; }
}
MyButton ( )
{
myProperties = new MyProperties ( );
}
}
Problem is, when I add a MyButton to a form, the designer lets me access (set) MyProp->MyProperty1. In the designer the MyButton control is responding correct to the setting of the property.
But no code is generated, so the properties are lost at runtime. Btw, this is about VS2005, not the Beta.
What requirement am I missing ?
Marcel