how to override backcolor in toolbar ?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I am trying to override the backcolor in the tool bar but I don't know how
to go about it.

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfSystemWindows
FormsToolBarClassBackColorTopic.htm

here it is
I need to override with public override Color BackColor {get; set;}

how can I do this ?

Thanks
Tom
 
Tom,

You have basically done it already. In your class that derives from
ToolBar, you declare:

public override Color BackColor
{
get
{
// The code to get.
}

set
{
// The code to set
}
}

Make sure that you call the base version though, as you want to make
sure that the base class is aware of the change when it occurs.

Hope this helps.
 
hello nickolas

I still don't understand. what sort of code do I need to put in get and set
? and also the current class being Form1 is already inheriting from
System.Windows.Forms.Form
public class Form1 : System.Windows.Forms.Form

how can I do this ?


Thanks alot
Tom



Nicholas Paldino said:
Tom,

You have basically done it already. In your class that derives from
ToolBar, you declare:

public override Color BackColor
{
get
{
// The code to get.
}

set
{
// The code to set
}
}

Make sure that you call the base version though, as you want to make
sure that the base class is aware of the change when it occurs.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tom said:
I am trying to override the backcolor in the tool bar but I don't know how
to go about it.

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfSystemWindows
FormsToolBarClassBackColorTopic.htm

here it is
I need to override with public override Color BackColor {get; set;}

how can I do this ?

Thanks
Tom
 
Back
Top