[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

syntax for enum?

Posted on 2006-04-11
3
Medium Priority
?
346 Views
Last Modified: 2012-08-14
Hi

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?
Thanks
Paul
0
Comment
Question by:paulwhelan
  • 2
3 Comments
 
LVL 12

Expert Comment

by:andrewjb
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 {..};
0
 

Author Comment

by:paulwhelan
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?

Thanks
Paul


0
 
LVL 12

Accepted Solution

by:
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 )

0

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