Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8678061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:36:56+00:00 2026-06-12T20:36:56+00:00

Hi there I got a problem with my application. I created a new UserControl

  • 0

Hi there I got a problem with my application.

I created a new UserControl called EntityOverviewPanel to show information about another class Entity visually.
In order to create an instance of this UserControl I would like to pass an instance of Entity in order to initialize the panel with all data.

public partial class EntityOverviewPanel : UserControl
{
    private Entity entity;

    public EntityOverviewPanel()
    {
        InitializeComponent();
    }

    public void setEntity(Entity e)
    {
        entity = e;
        updatePanel();
    }

    private void updatePanel()
    {
        //update panel
    }
}

If I try to execute this I get the error mentioned in the title:
Inconsistent accessibility: parameter type 'IFCS.Entity' is less accessible than method 'IFCS.EntityOverviewPanel.setEntity(IFCS.Entity)'

My Entity looks like this (only a part of the class because of its size^^)

class Entity
{
    public enum Gender
    {
        MALE, FEMALE
    }

    private int id;
    private Gender gender;
    private string surname, forename;
    private Group group;
    private Organisation organisation;
    private Station station;
    private string uid;

    public Entity(string surname, Gender gender, Group group, Role role, string forename = "")
    {
         //code
    }

    //more code
}

I read about changing class Entity to public class Entity would fix this problem but instead of doing that it just creates a whole bunch of new errors relating to other uses of Entity (with the same error message like in the title).

Any idea on how to fix this?
Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:36:58+00:00Added an answer on June 12, 2026 at 8:36 pm

    Well yes – either you need to make Entity public, or your setEntity method (which sounds like you’re writing Java rather than C#) internal. Changing EntityOverviewPanel to be internal would fix it too, IIRC.

    Fundamentally you can’t have a public method in a public class with a parameter or return type which is internal. It doesn’t make any sense to do so.

    If making Entity public causes further problems, that’s probably just because you need to do the same thing with other types. You really need to work out whether you do want Entity and its associated types to be public or not. If you don’t want it to be public, why do you want setEntity to be public?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got following problem: (c#) There is some class (IRC bot), which has method,
I've got a problem I was wondering if there's an elegant solution to. It
I've got probably what is a simple problem, but there's no informative errors or
There is an class android.os.Build that got static variables cointaining device info, but when
I've got a mad problem with an application I test with Selenium RC At
I've got a question about CakePHP and databases regarding an application idea I have.
I've got a problem to publish my Android Application. here's what i've done, so
I have the following problem: I created a iOS 5 SDK application with Storyboard
net web application with membership controls. By default the membership databases (ASPNETDB.mdf) got created
There has GOT to be a simple way to programmatically render HTML into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.