I want a "baby" form from my "main form" to update itself, whenever my main form changes something, let's make this clear using examples:
My "baby" form:
public partial class Ventoemparedes : Form
{
private Form1 Opener { get; set; }
public Ventoemparedes(Form1 opener)
{
Initializecomponent();
//stuff i wanna do whenever Form1 textBox.Text changes
method1();
}
private void method1()
{ //does stuff
}
}
My main form:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
//execute method1 on Ventoemparedes somehow???
}
private void button1_Click(object sender, EventArgs e)
{
Ventoemparedes mostra = new Ventoemparedes(this);
mostra.ShowDialog();
}
}
On Form1
I have a button
and a textBox
. The button
shows up the Form2
window.
What I wanna do, is whenever the Form1 textBox
value is changed, a method
written in Form2
will get executed and thus, update my Form2 window.
It should behave like a "refresh".
Is such thing even remotely possible?
I'm not very well versed in partial-classes and forms interaction, so I apologize if this is easy stuff to do.