Passing Data From parent Form to child Form with interface

  • Thread starter Thread starter alianware jack
  • Start date Start date
A

alianware jack

Guest
namespace Plugin
{
public interface sometext
{
string somethingtext
{
get;
set;
}
}
}

this is my Interface code

namespace PassDataThroughInterface
{
public partial class Form1 : Form,sometext
{
public Form1()
{
InitializeComponent();
}

public string somethingtext { get; set; }

private void button1_Click(object sender, EventArgs e)
{
somethingtext = textBox1.Text;
//================================other form
new TestPass().ShowDialog();
}
}
}


this is my main form

namespace PassDataThroughInterface
{
public partial class TestPass : Form,sometext
{
public TestPass()
{
InitializeComponent();

}

public string somethingtext { get; set; }

private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(somethingtext);
}
}
}


how do i pass the data on parent form to child form with using interface? or with other way without using class because the program i want to write is plugin base software. TQ

Continue reading...
 
Back
Top