Start New Discussion within our Software Development Community

1.I Have one form with a textbox

2.In keyDown event While pressing F1 an another form opens.

3.In the second form,i have a richtextbox.I want to edit tat richtextbox and pass that value to form1's textbox while clicking a button in form2.

Form1 Code:

private void Export_Load(object sender, EventArgs e)
        textBox1.Text = "hai hello welcome to chennai";
    }private void textBox1_KeyDown(object sender, KeyEventArgs e)
        if (e.KeyCode ==Keys.F1)
            rchbox rch = new rchbox();
            rch.richTextBox1.Text = textBox1.Text;
Form2 Code:

public rchbox()
    Export ex = new Export();
    Class1 c = new Class1();
    private void button1_Click(object sender, EventArgs e)
        c.txt = richTextBox1.Text;
        ex.textBox1.Text = richTextBox1.Text;
       // ex.textBox1.Invalidated();


I have found the problem that the form1 is not refreshed.i have even tried by calling refresh method. Can any one tell me.

I have different soln with out refresh
1-u declare static variable in form1 and store the value u want.
2-in form2,call form1.variable and use it as u like

This article has been dead for over six months. Start a new discussion instead.