I'm trying to create a custom control that has about 20 labels on it, I want to make the fore-color of these labels read-only, and make them change with the fore color of the control instead of all individually. The same with the back color. I also need to know how to re-size the font size of these labels when the developer using the control re-sizes it in designer mode that way it's not just a bunch of empty space in the control.
public override Color ForeColor
{
get
{
return label1.ForeColor;
}
set
{
this.label1.ForeColor = value;
this.label2.ForeColor = value;
this.label3.ForeColor = value;
}
}
public override Color BackColor
{
get
{
return this.BackColor;
}
set
{
this.BackColor = value;
this.label1.BackColor = value;
this.label2.ForeColor = value;
this.label3.ForeColor = value;
}
}
But I don't know how to override the label colors to where they are read-only. Any help is appreciated.