How to update textbox which is in another form

Posted by Sudhakar_A under Windows Forms on 2/3/2014 | Points: 10 | Views : 778 | Status : [Member] | Replies : 2
I have 4 form, in which form1 is the parent of form2 and form3.
When i run the program.

I display form2 and form3 in form1 which is the parent for both.

form3 is the Common output window which contains a richtextbox and remain opened in form1.

suppose in form4 ....i pass text to richtextbox, it is not getting displayed.

Instead when i write form3.show then it display the form3 and text value.


but i dnt want like that.
I want the form3 to remain open and update continoulsy.


pls help me sort out.

Thnk's in advance.




Responses

Posted by: Sravan661 on: 2/4/2014 [Member] Bronze | Points: 25

Up
0
Down

Posted by: Prabhukiran345 on: 2/5/2014 [Member] Starter | Points: 25

Up
0
Down
Hi,

Use the below code. This may help you.
 public void Call_UpdateBox(Form1 Sender)
{
//do looping for doing some tasks here and update textbox every time
sender.UpdateBox();
}

and..

public void UpdateBox()
{
textBox1.Text = "hello";
}



Thanks,
Prabhu Kiran Bommareddy

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response