Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir/s

I have main windows form from that form i am calling another form.

VB
dim frm as new frmchild(loginid)
frm.show()


now from this child form i want to update textbox value of main form.
Please help me i have tried a lot.

while debugging is shows values are changed but actual on the main form it does not get reflected new values.

Thanks

What I have tried:

on main form i had use one timer which update textbox value of main form.and this timer i enabled it on child form.

frmmain.timer1.enabled=true
as soon this timer get enabled timer1 update textbox value.
Posted
Updated 16-Aug-16 22:23pm

1 solution

Create an Event in your child form which the Main form handles: https://msdn.microsoft.com/en-us/library/ms172877.aspx?f=255&MSPPError=-2147217396[^] - when your child wants to update the main form, it raises the event.
Add a property to the child to return the data that you want you update with.
In the main form event handler, access the property via the instance of the child form - either by saving the instance when you create it in the code you show above, or via the sender parameter to the handler method. The main form then updates itself with the new data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900