Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
       {
           panel2.Controls.Clear();
           panel2.Visible = true;
           forgotpass r1 = new forgotpass();
           r1.Show();
           panel2.Controls.Add(r1);

       }


if i use "ff.hide" its not hiding, i need to hide this forgotpass USER CONTROL to be hide....


.
Posted
Updated 8-Dec-12 20:07pm
v4
Comments
Sergey Alexandrovich Kryukov 9-Dec-12 0:07am    
If could be System.Windows.Forms, it could be WPF, it could be something else. You always need to tag the UI library you are using.
--SA
Sergey Alexandrovich Kryukov 9-Dec-12 2:08am    
Please, why do you reply to my comment if you are ignoring its content. There is nothing to discuss before you tag UI library you use. Indirectly, I can see that this is most likely System.Windows.Forms, but not because you correctly specified it.

Hiding controls never been a problem. It's unclear what is your problem. Hide it, show it, why not?
--SA

You must have a reference to the usercontrol or know its index in the panel's controls collection at least.

C#
forgotpass ff; //or int ffIndex;

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
     panel2.Controls.Clear();
     panel2.Visible = true;
     ff = new forgotpass();
     ff.Show();
     panel2.Controls.Add(ff);
     // ffIndex=panel2.Controls.IndexOf(ff);
}
 
void HideFF() 
{
    ff.hide(); // or panel2.Controls[ffIndex].hide();
}
 
Share this answer
 
v2
Comments
selva_1990 8-Dec-12 13:44pm    
reference in the sense...? i m beginner can u help me briefly
Ravi Bhavnani 9-Dec-12 11:59am    
What kind of app is this? A web app, a Windows Forms app or a WPF/Silverlight app?

/ravi
set the Visibility of a property to Visibility.Collapsed

C#
control.Visibility = Visibility.Collapsed


this will hide and remove the space of the control that it is occupying

hope this helps
 
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