'doing project but for some reason cycle doesn't work
i'm drawing rectangles in line, and every turn it's supposed to delete one rectangles every turn, until i wont be less than 1, but for some reason it's only deleting one rectangle and thats it, what am i doing wrong?
namespace WindowsFormsApp3
{
public partial class Form1 : Form
{
int i;
int j;
int h = 0;
int w = 0;
int x = 0;
int y = 0;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
Graphics gr = panel1.CreateGraphics();
{
for (i = 5; i > 1; i--)
{
gr.DrawRectangle(Pens.Black, x, 70 + y, 60 + h, 60 + w);
x += 70;
}
x = 0;
y += 70;
}
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
