UserControl property's DefaultValue for type Size

  • Thread starter Thread starter pompair
  • Start date Start date
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);
}
}
 
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

Use:

[DefaultValue(typeof(Size), "114,48")]
 
Back
Top