Beecontrol also needs to release its own controls
The control class implements
Idisposable
Interface, so you need to make sure that each used control is released.
Beecontrol
Contains
Timer
Control, but it cannot be released. This is a problem. Fortunately, this problem is easily fixed.
--
Overwrite
Dispose
() Method.
③ Override dispose
() Method to release
Timer
Beecontrol inherited from
Control
, So it must contain
Dispose
() Method. So we can override this method to release it.
Timer
. Enter the code and type
Override
:
Click dispose in the smart sensing window.
,
IDE
Will be used
Base. Dispose
() Fill this method with this statement:
④ Add code to process Timer
To ide
Add a row for the filling method:
Now your beecontrol
Can be processed
Timer
. Set
IDE
Leave the line of code generated for you there.
Picturebox
It can also be processed.
Clear timer now
Already
Beecontrol
Of
Dispose
() Part of the method.
Custom controls must be used to clear other controls created in them.