I have researched a lot on how to get this working but I couldn't solve the problem, I also didn't like some of researched method because I believe it wastes Ram Space. Anyway, This is the problem:
I have two form: Form1(Has DataGridView(Modifier: Public), TextBox1, Button1) - Parent Form Form2(Has TextBox1, Button1) - Child Form
public partial class Form1 : Form
{
Pivate Void Button1_Click()
TransferText("Text_Example")
Public Void TransferText(string text)
Form2 frm2 = new Form2();
frm2.show()
frm2.textbox1 = text;
}
This obviously does not work, What is the correct way to do this ? I am trying to OPEN Form2, and change the textbox1 value of Form2.
On Form2, I have this code:
public partial class Form2 : Form
{
Private Void Button1_click()
RowAdder("Example-Text", "Example2");
Public Void RowAdder(string text1, string text2)
Form frm1 = ?? // What should I write here ?
frm1.DataGridView1.Rows.Add(text1, text2)
This also does not work, so how can I fix this ? I am trying to add rows on Form1, from Form2.
Any help on this issue is greatly appreciated. I have been stuck on this for awhile.