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 7647095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:22:45+00:00 2026-05-31T10:22:45+00:00

OK so I understand that ion VB6, encapsulated properties in a class can belong

  • 0

OK so I understand that ion VB6, encapsulated properties in a class can belong to one of three categories:

  • Public Property
  • Friend
  • Public Variable

What is the difference between these and how do these compare to public and private properties in a more modern language like C#?

  • 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-05-31T10:22:46+00:00Added an answer on May 31, 2026 at 10:22 am

    The scope qualifiers Public and Friend determine whether clients in different projects can see the item.

    • Public items will be accessible to client code in other projects1 and code in the same project.
    • Friend items are accessible only to code in the same project, not to code in other projects.
    • Private items are accessible only to code in the same class.

    Properties are different from public variables, because with properties you can execute your own code when the client gets or sets the value2. EDIT following Deanna’s comment: Also note that variables can be passed ByRef to a function and changes will work as expected. This is NOT the case for properties.

    NB C# may be more modern, but IMHO the VB6 treatment of properties and public variables is significantly better than the .Net treatment.

    • In VB6 you can change a public variable into a property without breaking the clients. You don’t even have to recompile them. Not true in .Net.
    • In VB6 public variables can be used with data binding. Not true in .Net.
    • In VB6 public variables could be used with interfaces. Not true in .Net.

    IMHO Microsoft made a real design mistake in creating these differences between properties and public fields in .Net. Not convinced? After the first releases of .Net, the C# and VB compilers were modified to support automatically implemented properties. These allow you to create properties in just one line of code, so that it’s later possible to add logic on get/set without causing problems. IMHO this proves that public variables should have been made indistinguishable from properties.


    1 Assuming your project type actually allows your classes to be used by other projects (i.e. ActiveX DLL, OCX, or ActiveX exe).
    2 In the Property Get, Property Let and Property Set procedures.

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

Sidebar

Related Questions

understand that in App.Xaml.cs, I can create global variable and properties. How do I
I understand that CoCreateInstance finds the COM server for the given class id, creates
I understand that there is a *.className selector since there can be multiple html
I understand that a class will have a VTABLE , if it contains at-least
I understand that a const pointer can be declared a couple ways: const int
I understand that if else staments should say stuff like: if dog equals one,
I understand that @synthesize window; combined with @property 'auto-creates' your setters and getters, but
I understand that fields such as Html.TextBox() accept two values, the first one being
I understand that only one instance of any object according to .equals() is allowed
I understand that when fetching an atom feed, you can specify the number of

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.