Specifying a unique control name when adding at runtime (like the VS IDE)
- by user316383
hi,
I have a basic IDE for a user control i am building. It allows me to add labels to a panel and move them around, like a very basic form designer.
When I add the controls to the panel at runtime, I'd like to give the control a unique name string like how the VS IDE tracks the controls it already has and adds an extra number when it creates the default control name. I have tried checking the controls collection each time a new control is added, but wasnt sure if there was a good string comparison method to return a name with a unique number on the end that hasn't been used yet.