I have implemented custom control by overriding TextBox component. it has a custom property named “DbColumn”. i wanted it to act like “Name” property on TextBox, which is one Form cannot have component with same “DbColumn” value on two controls.
Is there a way to set attributes to have unique value across one Form?
If runtime check is enough for you, try implementing
System.ComponentModel.ISupportInitializeand add checking logic toEndInit():This is pretty expensive in that form, but can be easily optimized to perform the check once for every parent container, instead of
ntimes (fornnumber of MyTextBoxes).