I've got a form that builds a control array on a form, and later destroys some random controls from that array. Does anybody know how I can later check for the existence of a certain array member?
Printable View
I've got a form that builds a control array on a form, and later destroys some random controls from that array. Does anybody know how I can later check for the existence of a certain array member?
If you access some property of a control that doesn't exist, I would expect that you would get an error. There may be a better way to do this, but one possibility would be to write a brief function that takes a control as an argument and returns a boolean. The function would reference the property, and catch any errors generated. If the error indicates that the control doesn't exist, return false, if no error occurs, return true.