Naredla Nithesh

Naredla Nithesh

  • NA
  • 328
  • 79.2k

how to reset user control to its initial state

May 4 2014 10:11 AM
Hai friends...
     In my application.. i have a user control,when i am clicking on the add button of my application..it should create a object to the user control,and the created user control copy should be added to a panel control... i did all this...but what my problem is along with add button ..i have a reset button ..when i am clicking on this button it should reset all the user control that are added to the panel....How can i do this......any one have an idea..please help me
and my reset code is
foreach (Control x in bodyPanel.Controls)
{
if (x is TimerUserControl)
{
obj_TimerUserControl.ResetControl();
}
}
when i execute this the last created object only get reset....remaining all are running as usual....in this code snippet Resetcontrol() is a method which is declared in TimerUserControl.
please help me.Thank you. 

 

Answers (3)