hi all pleasssssssss help with this problem im working with multi form project and when i run the program it dont give an errors but its dont work when click button to move through the forms the code which i used :

private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton2.Checked)
            {
                result4 = 1;
                check4 = 1;
            }
            else
            {
                if (radioButton1.Checked)
                {
                    result4 = 0;
                    check4 = 1;
                }
                else
                {
                    check4 = 0;
                    result4 = 0;
                }
            }
            Form26 f26 = (Form26)Application.OpenForms["Form6"];\\the problem which the          program show here....
            this.Hide();
            f26.Show();

        }

pleas what i have to do with this .....??

Recommended Answers

All 11 Replies

Form26 f26 = new Form26();
f26.show();

But I want to I keep the changes that will occur on the form when I go back again and in this way will return to the form without the modifications.....

Is "Form6" already open? If so, then what code did you use for opening it? And where?

Is "Form6" already open? If so, then what code did you use for opening it? And where?

i used

Form6 f6=new Form6();

at Form4 ... then at form 7 i want to com back for form 6 i used

Form6 f6=(Form)Application.OpenForms["Form6"];

actully i have more than 30 forms.....when i define button next i use new in previous i use application.OpenForms...!!!!

You could also use the Hide property of the form, so when you click the next button as you mentioned, then the form will be hiden and maintain its data.

Hope i helped :)

You could also use the Hide property of the form, so when you click the next button as you mentioned, then the form will be hiden and maintain its data.

Hope i helped :)

thanx alexpap..:)
but my prob is the program dose not respect this....openForm application....!
:)

You should try and "play" with the Form.Show() and Form.Hide() Functions... :)

oh finally worked.......!!!:)
but i got another problems oh hope to done with this project.....:(

Contact me via pm for more problems, and mark this post as solved

Thanks :)

>Contact me via pm for more problems

Then what is the purpose of this Thread. Please post your problems & their respective solutions on the board.

>Contact me via pm for more problems

Then what is the purpose of this Thread. Please post your problems & their respective solutions on the board.

What i meant, is if he has any other problems with that spesific subject then he could ask me through PM's too ;)

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.