C
C#6mo ago
❆ 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); }
2 Replies
Pobiega
Pobiega6mo ago
it doesn't register when I type Black for the fill color, saying it doesn't meet the required parameters.
Can you show a screenshot of where this is happening?
❆ Snow ❆
❆ Snow ❆OP6mo ago
Apologies, but I figured out what was wrong now Sorry for wasting people's time
Want results from more Discord servers?
Add your server