hi. I make a project and I have a qouestion. I want to send some data from one windows form to another. The first one is a form, which calculates the discount of a product. The other form has a dataGridView and I want to send the data from DiscountForm to dataGridView cell (for example cell[5]). There is EditButton in DiscountForm and I want to send the data to dataGridView's cell after pushing the button.
Some ideas?

the editbutton only sand the data to datagridview cell. The form is already open. The form has a datagridview i load data from database. when i load some product(its a software for sales) i want to make a discount of this product, so i made a button in this form, called "Discount". and when i push the "Discount" button, opens a form,which calculates the discount when i enter a data in the textboxes. so there are 3 textboxes and the last is for results (the discount). when i push the "editbutton" i want to send the discount value to cell "discount" in datagridview in the other form

you can set the modifire property in property window of your control public from private , then you can access it on your second form like this

frmMain frm = new frmMain();
txtGetText.Text = frm.txtMyText.Text

hope this will help you.

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