I tried to understand some examples of this but the examples that I read dont really explain what they use it for.
The nearest what I can think of is some kind of example like this but are not sure if I am close to any solution.
However I have a feeling something is very wrong.
Here I try to assign the String^ name = "PassThisString" to get() in a messageBox in Form2.
Written in Form3:
Code:
private: String^ _name;
public:
property String^ Name
{
void set (String^ name)
{
_name = name;
}
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e)
{
name = "PassThisString";
}
Here I try to get the value from the set String^ _name.
Written in Form2:
Code:
public:
property String^ Name
{
String^ get()
{
return _name;
}
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e)
{
MessageBox::Show(_name);
}