lbevs
lbevs

Reputation: 21

C# private class MyColors

private class MyRenderer : ToolStripProfessionalRenderer
{
   public MyRenderer() :base(new MyColors()){ }
}

private class MyColors 
{
   public override Color MenuItemSelected
   {
      get { return Color.; }
   }
}

I am struggling getting my errors to be fixed. I have an error on the

base(new MyColors())

line and then again on the

public override Color MenuItemSelected

line and lastly on

get { return Color. ;}

The errors are CS1503 CS0115 CS1001 respectively. I am not sure how to fix these but I think if I fix the first one I can make out the others.

Upvotes: 0

Views: 70

Answers (1)

Juan Medina
Juan Medina

Reputation: 559

First you need to change you methods to public instead of private. Then you need to use () to declare the function. Also, you need to declare the variable you will return of type Color (I will call it m_color Then you need to remove the get and leave only the return (and remove the extra . you have)

You should have something like this:

public class MyRenderer : ToolStripProfessionalRenderer
{
   public MyRenderer() :base(new MyColors()){ }
}

public class MyColors 
{
   private Color m_color;

   public override Color MenuItemSelected()
   {
      return m_color;
   }
}

Upvotes: 2

Related Questions