Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving the name of a variable

Status
Not open for further replies.

cpastre

Programmer
Nov 13, 2002
10
US
I'd be grateful if one of you good folks would please explain to me a method by which I may obtain the name of a variable. Specifically, I'm iterating through a MenuItems collection and I'd like to compare the name of each MenuItem to a value stored in a database in order to determine whether the menu item should be enabled for the user. For example...

<code>
MenuItem miTest;

Console.Write(GetVariableName(miTest)); //would output &quot;miTest&quot;
</code>

Thanks,
Charlie

Charlie Pastre
cpastre@t1mas.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top