hello everybody ,
i need help in my project Break out game , Rectangles can not disappear when the ball hitted one rectangle
here is my project :
http://www.mediafire.com/?3iiipzrys7w3780

Hi Waledsalah, welcome at DaniWeb.
could you post a zip file instead of a rar?
To erase a Rectangle, just redraw it in the background color of the container it is drawn in.

If you're referring to the Rectangle class (from GDI+) - you can't "delete" a rectangle if it was already drawn.

You can try to draw another rectangle over the one you want to erase, with the same color as the form's BackColor or use, on your form, this.Invalidate() (which will remove any rectangle, so you'll have to redraw everything - might cause blinking effects).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.