Quote:
|
Is there a way to delete a control at run-time and also a way to check if a control exists?
|
You need to Dispose of the control. I'm not familiar with finding out whether the control exists in the first place though.
You could just try to Dispose of all the controls and trap/ignore the error that would be generated if the control wasn't present.
I also believe that Disposing of a Form will Dispose of all controls that were present on it. This may have changed with version 5 though??
EDIT: I replied at the samtime as Erel, sorry. As normal I prefer Erel's solution.
Regards,
RandomCoder.