all groups > dotnet windows forms > march 2007 >
You're in the

dotnet windows forms

group:

passing values between forms



passing values between forms mydotnetdoubt NO[at]SPAM gmail.com
3/13/2007 2:19:06 AM
dotnet windows forms: Hai dear all,.

How can i capture child form close event in parent form in c# 2005,

I'll make it some more clear , I have one master form with 40 text
boxes, and one 'search' button , in the search button im calling child
form
(Form fReg = new frmRegistration();
fReg.Show();) ,there Im searching some data and filling some
possible data in a data grid ,out of tat im selecting one data from
the data gird, and the selected data should fill the all the text box
in the parent form- how can I do ?

Im trying to do the same by assigning the selected value in a pubic
field and access the same in the parent form at the time of child form
close event and generate the relevant
fields from the data base by executing sql once agn..

Please suggest me the best practice for this .

Nau
Re: passing values between forms VJ
3/13/2007 9:44:09 AM
You need raise event in your DataGrid row selected. In the event pass
information i.e values to fill in textbox in parent Form,
then you need to subscribe to the event in Main form and use the values
recivied.. The below link will give you idea of event handling...

http://www.c-sharpcorner.com/UploadFile/ddutta/EventHandlingInNetUsingCS11092005052726AM/EventHandlingInNetUsingCS.aspx

VJ

[quoted text, click to view]

AddThis Social Bookmark Button