Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 8-Dec-12 7:03am
Edited 8-Dec-12 20:07pm
v4
Comments
Sergey Alexandrovich Kryukov at 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 at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You must have a reference to the usercontrol or know its index in the panel's controls collection at least.
 
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();
}
  Permalink  
v2
Comments
selva_1990 at 8-Dec-12 13:44pm
   
reference in the sense...? i m beginner can u help me briefly
Ravi Bhavnani at 9-Dec-12 11:59am
   
What kind of app is this? A web app, a Windows Forms app or a WPF/Silverlight app?
 
/ravi
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

set the Visibility of a property to Visibility.Collapsed
 
control.Visibility = Visibility.Collapsed
 
this will hide and remove the space of the control that it is occupying
 
hope this helps
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 605
1 Sergey Alexandrovich Kryukov 305
2 BillWoodruff 259
3 PIEBALDconsult 220
4 CPallini 220


Advertise | Privacy | Mobile
Web02 | 2.8.141029.1 | Last Updated 9 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100