❆ Snow ❆
Color parameter problem
Hey guys! I could use some help with my method I created in Visual Studio. Long story short, it's for a Univeristy project. The project is supposed to draw a bar graph and fill it with a specific color. Probelm is when I call the method, it doesn't register when I type Black for the fill color, saying it doesn't meet the required parameters.
private void DrawABar(Graphics paper, int x, int y, int length, Color colour)
{
//create a brush of specified colour and fill background with this colour
SolidBrush brush = new SolidBrush(colour);
paper.FillRectangle(brush, x, y, BAR_WIDTH, length);
//draw outline in black
paper.DrawRectangle(Pens.Black, x, y, BAR_WIDTH, length);
}
4 replies