I am trying to create a custom command button that, by default, sets the width and height for certain parameters. I have the following code:
public partial class myCommandButton : Button
{
public magCommandButton()
{
InitializeComponent();
}
[DefaultValue(840)]
public override int Width
{
get
{
return base.Width;
}
set
{
base.Width = value;
}
}
[DefaultValue(340)]
public override int Height
{
get
{
return base.Height;
}
set
{
base.Height = value;
}
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
}
However, it will not compile because it tells me that I cannot redefine width or height. Can someone tell me if I am approaching this incorrectly, or if there is a way around this?
source
share