When changing the time frame, the checkbox is unchecked

 

Hi

I added a checkbox to the graphical panel, When I tick the checkbox and then change the time frame, checkbox status (Checked or Uncheck) is reseted.

 
If the graphic panel is created in OnInit() , when you change the timeframe this will run that code again. 
if your code doesn't keep track of the checkbox state and apply that value when it is recreated it will have the default value.
 
Douglas Prager #:
If the graphic panel is created in OnInit() , when you change the timeframe this will run that code again. 
if your code doesn't keep track of the checkbox state and apply that value when it is recreated it will have the default value.

Thank you for answering

Funny, I used the CCheckBox class so I don't want to track the status of the checkbox. I'm trying to minimize state tracking by using a static variable.