P
pompair
Hello,
Is there a way to assign a defaultvalue for a Size-type in a
UserControl's property?
For example this code won't compile:
[Description("Size of buttons"), DefaultValue(Size(114,48))]
private Size ButtonSize
{
get { return toggleButton1.Size; }
set
{
toggleButton1.Size = value;
toggleButton2.Size = value;
Size newpos = new Size(toggleButton1.Location.X +
this.ButtonSize.Width + this.ButtonSize.Width / 10,
toggleButton1.Location.Y);
toggleButton2.Location = new Point(newpos);
}
}
Is there a way to assign a defaultvalue for a Size-type in a
UserControl's property?
For example this code won't compile:
[Description("Size of buttons"), DefaultValue(Size(114,48))]
private Size ButtonSize
{
get { return toggleButton1.Size; }
set
{
toggleButton1.Size = value;
toggleButton2.Size = value;
Size newpos = new Size(toggleButton1.Location.X +
this.ButtonSize.Width + this.ButtonSize.Width / 10,
toggleButton1.Location.Y);
toggleButton2.Location = new Point(newpos);
}
}