[Webinar] Streamline your web hosting managementRegister Today


syntax for enum?

Posted on 2006-04-11
Medium Priority
Last Modified: 2012-08-14

I have a field

private displaytext _eDisplayText;

an enum

private enum displaytext { text, description };

and property

public displaytext DisplayText
            get { return _eDisplayText; }
            set { _eDisplayText = value; }

but it underlines DisplayText in the property and says

Error      16      Inconsistent accessibility: property type 'DefaultControlsPlugin.Controls.ElementLabelControl.displaytext' is less accessible than property 'DefaultControlsPlugin.Controls.ElementLabelControl.DisplayText'      

Any ideas?
Question by:paulwhelan
  • 2
LVL 12

Expert Comment

ID: 16424759
You've defined your enum to be private, but are providing a public property to get/set it...

Just change to

public enum displayText {..};

Author Comment

ID: 16424808
Great thanks

Now I had a bool value in there before and I used to do

if (oElementLabelControl.DisplayText == false)
How will I change that for enum?


LVL 12

Accepted Solution

andrewjb earned 120 total points
ID: 16424839
if (oElementLabelControl.DisplayText == displaytext.description )

Or, if your displaytext enum is defined within some class, like:

class MyClass
  public enum displaytext {..}

then it'd be

....== MyClass.displaytext.description )


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question