Inconsistent accessibility: property type X is less accessible than property Y

Posted on 2006-03-23
Last Modified: 2011-08-18
I am trying to add the C# event below to a custom control.  However I am getting the follwing error, please help.

Inconsistent accessibility: property type 'CA.UI.CustomControls.uccPostalCodeSearchEditor.SelectedItemHandler' is less accessible than property 'CA.UI.CustomControls.uccPostalCodeSearchEditor.SelectedItem'

//Definitions for the SelectedItem Event
//SelectedItem event is raised when the user selects a Record.
delegate void SelectedItemHandler(object sender, PostalCodeSearchEditorSelectedEventArgs e);
private SelectedItemHandler SelectedItemEvent;
public event SelectedItemHandler SelectedItem
            SelectedItemEvent = (SelectedItemHandler) System.Delegate.Combine(SelectedItemEvent, value);
                               SelectedItemEvent = (SelectedItemHandler) System.Delegate.Remove(SelectedItemEvent, value);
}  // END: public event SelectedItemHandler SelectedItem

Also below is the working VB code:

Delegate Sub SelectedItemHandler(ByVal sender As Object, ByVal e As PostalCodeSearchEditorSelectedEventArgs)
Public Event SelectedItem As SelectedItemHandler
Question by:wenyonk
    LVL 96

    Accepted Solution

    It means that you can't expose an internal member from a public member:

    public delegate void SelectedItemHandler(object sender, PostalCodeSearchEditorSelectedEventArgs e);

    LVL 96

    Expert Comment

    by:Bob Learned
    I try to get in the habit of always specifying scope modifiers to all declarations, like classes, properties, events, etc.


    Author Comment

    Thank you LearnedOne!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now