Click here to Skip to main content
15,891,684 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi


good evening
i my application i am hidding the forms at some places , when ever i want to retrive at that time i want to get the hidden correspondingform , if there is no corresponding hidden form at that time i want to call the correspoding form at that time by using a.show();(i.e object)


in windows application C#.net
please give me a idea
Posted
Updated 14-Aug-10 0:24am
v2

Where are you hiding?

See if you are keeping the reference open, just call the reference to get the file.

Form frm = new Form();

now if you hide using
frm.Hide();

it will be hidden. To show the same file use
from.Show();

If you dont have frm with you, that means the object is out of scope and will be in process of Garbage collection.

On the other hand, if you want your form to be out of strong reference so that it will be left for garbage collection but still want to check whether the form is not yet garbage collected or not, you need to use WeakReference for that.

I have written one article on how you can use WeakReference to enhance performance of your application. You may read :
http://www.abhisheksur.com/2010/07/garbage-collection-algorithm-with-use.html[^]

:thumbsup:
 
Share this answer
 
Whenever you hide or show a Form or any other Control its Visible property changes, so you can check through Visible property that Form is hidden or not.
 
Share this answer
 
Comments
[no name] 16-Aug-10 8:08am    
Reason for my vote of 3
good one

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