8
Answers

form trouble

j_sen21

j_sen21

17y
2.6k
1

Hello,

In opening form 1,   I open form 2 in the constructor before I initialize componentss().

I created a public variable to set a int value in form2 so that if the correct value is returned, form 1 continues on its way, otherwise the project closes. I recieve this error when the retuned value is not set to 1, when i want the project to close. Is there another way that works? Is there a way to create a int value return for form 1?

HelPPP! THanks.

"Make sure you have not released a resource before attempting to use it. "

public Form 1()

{

Form2 frm2 = new Form2();

frm2.ShowDialog();

if (frm2.returned_value == 1)

initializeComponents();

else{this.close();}

}

 

Answers (8)