PLS HELP!!! UserControl "Name" property returns class name (!!!)

  • Thread starter Thread starter MuZZy
  • Start date Start date
M

MuZZy

Hi,

I'm having a problem here:
If i want to get a UserControl's name on run-time, UserControl.Name
returns class name instead of instance name, eg if i have a UserControl
inherited class MyUserControl and in code i do:

MyUserControl myUctl;
....
string strName = myUCtl.Name

the string strName contains "MyUserControl" (class name) instead of
"myUCtl" (object name).

It happens with all UserControl inherited classes..

Any ideas on how to obtain the actual name of the object would be HIGHLY
appreciated!

Thank you,
Andrey
 
Brad said:
Have you tried overriding the to string method?

Hi Brad, thank you for reply.
I actually found the problem - i was debugging design time instead of
runtime - at runtime it works fine
 
Back
Top