Usercontrol's 'name'

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
Further to my recent post about wiring in events in my usercontrol i noticed that the default text property for any control contains it's name as it appears in the properties window.

I.e in has the name of the control and the number that follows

Usercontrol1
Usercontrol2 etc......

i can certainly make the name appear, however i cant seem to get my control to display the number. i've tried everything i can think of. Can any one tell me how i would get this value.
 
Thats right is doesn't. Setting my custom text property inside my user controls constructor to the name property only adds the actual name of the control, not the number.

I dont suppose it's a big problem as i could just use the text property that already there, rather than my custom property. I was just wondering how it could be done. I havent been using vb.net very long and i guess you just never know when you may need to do things like this.

I would still be very interested if you could help as i've been trying to figure this out for about 5 hours now and i can't seem to find any info on how to accomplish this anywhere.
 
Back
Top