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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public Enum Not Visible in Class 1

Status
Not open for further replies.

LLDLLD

Programmer
Jan 25, 2007
5
US

I was wondering if anyone knew why a public enum does not show up to use after creating an instance of the class that it resides in?

For example:
In ClassWithEnum:
public enum Values
{
value1 = 0,
value2 = 1
}

Then, create an instance of the class:
ClassWithEnum myClassInstance = new ClassWithEnum;

When I look at what is available to use in the Class, the enums don't show up. I only see methods and public variables such as strings, etc.

I would like to use: myClassInstance.Values.value1
- but it isn't available.
 
Yes,

use instead of myClassInstance.Values.value1
this: ClassWithEnum.Values.value1

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top