
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 0.65 KB | hits: 4 | expires: Never
How to inherit variables from between forms in Visual Studio, C
public ref class Form2 : public System::Windows::Forms::Form
{
public ref class Form1 : public System::Windows::Forms::Form
{
public ref class Form2 : public System::Windows::Forms::Form, public Form1
{
public ref class Form2 : public Form1
{
public interface IMyForm
{
int MyValue { get; set; }
}
public class Form1 : System.Windows.Forms.Form, IMyForm
{
public int MyValue { get; set; }
...
}
public class Form2 : System.Windows.Forms.Form, IMyForm
{
public int MyValue { get; set; }
...
}
public void DoSomething(IMyForm form)
{
form.MyValue = 5;
}