Link to home
Start Free TrialLog in
Avatar of madmare
madmareFlag for Israel

asked on

Remove Panels

hi all,
 i wrote a code that in each time the user press on Button my program add a Panel on a PictureBox, how do i Remove all the Panels that  the user add

Panel p1 = new Panel();
p1.Top = left_dise_click_Y(e.Y);
p1.Left = left_dise_click_X(e.X)+1;
p1.Width = Convert.ToInt16(textBox3.Text)*DisesX-1;
p1.Height =Convert.ToInt16(textBox4.Text)*DisesY-1;
p1.BackColor = Color.Yellow;
pictureBox2.Controls.Add(p1);
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
also if you adding panel ad design time and runtime, and would only remove the panel you added at runtime
you could use Tag property to add value for the panels at runtime, and test if the value exist to remove the panel
Avatar of madmare

ASKER

thnx mnasman
glad to help :-)