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?
Thanks!

Does this 'editbutton' load the second form, or is it already open?

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

It will be worth reading: Link and Link. Personally I'm not sure how it's done but Google is a wonderful tool.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.