Virtual properties : Property « Class « Visual C++ .NET






Virtual properties

 

#include "stdafx.h"

using namespace System;

ref class Base
{
   public:

   virtual property int Prop;
};

ref class Derived : Base
{
   int prop;

   public:

   virtual property int Prop
   {
      int get() override { return prop; }
      void set(int value) override { prop = value; }
   }

};

   
  








Related examples in the same category

1.Array Property
2.Static Property
3.Scalar number Property
4.Defining Index Properties
5.Indexed properties
6.Indexed properties 2
7.Property accessor delegate
8.Static property
9.Declaring properties
10.Write only property
11.Public properties can be used as named parameters