I have three form form1, form2, form3. in form one a button opens form3. and in form2 also a button for opening the same form as form3. Is it possible and how? becoz when i was simply chen this code for open form this form this was not working.
there was error "best overload method match for form3.

Recommended Answers

All 8 Replies

You can click the following code as many times as your computer memory will allow it.
You will have as many forms.

private void button1_Click(object sender, EventArgs e)
        {
            Form f = new Form();
            f.Show();
        }

i have use this but the error is does not contain a constructor that takes 0 argument. this error is in both form 1 and form 2.

You dont need any constructor. At least if you open form2 from from1 (or form3 from form1).

Show your code.

Maybe you have any parameter(s) in the constructor on form3 (form2). If you have it, and you dont need to pass any from form1 you do:

Form3 f3 = new Form3(null);
f3.Show();

This is working but i want fill some data from form 3 to form1 and form2 then error is coming
does not contain a constructor that takes 1 argument

Did you see my example I did it for you? Thats the example you hav to follow.
You know, when you selected a doctor in the dataGridView, and the his name and Id is passed from that form to the main one (so backwards).
Check ans study that example. The answer lays there.

@ mitja if want to use this data grid view form in other form then what i do?

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.