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

  • Home
  • SEARCH
  • 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 187745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:52:41+00:00 2026-05-11T15:52:41+00:00

I got some set of base classes within one namespace and few sets of

  • 0

I got some set of base classes within one namespace and few sets of derived classes in other namespaces. Everything in one project. Something like:

Namespace Base Public Class BaseElement     Protected Friend Readonly Property SubElements() as BaseElements End Class End Namespace ... Namespace Books Public Class Book     Inherits Base.BaseElement     Public Readonly Property Pages() as Pages         return MyBase.SubElements     End Property End Class End Namespace 

I have multiple derived classes and want them to have some easily understandable properties visible instead of .SubElements.

OK, it can be done declaring .SubElements as Protected in BaseElement class. But in this case I cannot access this property from other classes in Base namespace that are not derived from it.

I tried adding Friend keyword, but it made this property visible when I’m instantiating derived classes too.

So… any way to hide some properties when using derived classes while being able to use them using base class?

  • 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. 2026-05-11T15:52:42+00:00Added an answer on May 11, 2026 at 3:52 pm

    .NET doesn’t have namespace-based visibility modifiers.

    You could potentially move everything in that namespace into its own class library project, and have it as a Friend member – or you could just live with it having more visibility than you want.

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

Sidebar

Related Questions

So I've got some scripts I've written which set up a Google map on
I've got some Columns in a DataGridView that have their Binding property set to
I'm using Google Test Framework to set some unit tests. I have got three
I've got a simple MVC (RC1) app set up, and I'm seeing some odd
I got some weird error with response.redirect() and the project wasn't building at all..
I'm having some inheritance issues as I've got a group of inter-related abstract classes
I'm trying to maintain one repository, most everything in my code base is source,
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I got some problems with finding a bug in php/mysql application, and I wonder
I got some legacy code with that caption spread out as comment almost in

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.