Hi there,
I am a C# Newbie and need to create an application with a user control. The user control must consists of three panels, each with a different colour. I must use Properties, get and set, to return the colour of the panel.
My problem is that I have no idea how to reference the panels' colour in the properties. To create a single panel with a single colour is fine, but doing it with three is a problem for me.
Help will be appreciated.
Loading
Jacques Vd WesthuizenPosted Jun 17, 2008, 11:40 AM
Thanks for your help. It worked great.
Thanks again.
Regards
Jacques
Mike HankeyPosted Jun 16, 2008, 6:40 PM
Its the same for three as for one.
private Color _Panel1Color;
public Color Panel1Color
{
get { return _Panel1Color; }
set
{
_Panel1Color = value;
Panel1.Color = _Panel1Color; //Set the panels actual color here!
}
}
Repeat this for the other 2 panels.
Hope this helps,
Mike