Click here to Skip to main content
15,881,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the following I am trying to hide the current form and want to show the CrystalReport through
Form5. It is not happening. What is happening is that both are showing. I could see the
Gridview 'gvUserInfo' (which I want to hide) and CrystalReport through Form5. Ofcourse the
crystal report is behind the Gridview. If I minus the Gridview, I could see the Form5 result.
I dont want the Gridview to be shown from the current form which I want to hide.


gvUserInfo.DataSource = ds11.Tables[0];
gvUserInfo.Visible = true;
this.Visible=false;
Form5 obj1 = new Form5();
obj1.Show();
Posted

1 solution

You can easily use this.Close() or this.Hide() method before creating Form5 object like this.

this.Close(); // Dispose the current form object.
Form5 obj1 = new Form5();
obj1.Show();

or

this.Hide(); // Do not dispose the current form object.
Form5 obj1 = new Form5();
obj1.Show();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900