Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.5 C# GUI
How to hide the previous form when we click on new form.
I tried it by using HIDE() property.Its not working pls guide me even if it is to be used tell me where to use it.
Posted 13-Feb-12 19:22pm
Comments
CRDave1988 at 14-Feb-12 1:28am
   
How u use hide can u show ur code?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

There is no member HIDE(), and such member would be a method, not a property.
 
There is a method Hide(), it always work. I don't know what exactly you screw up; there are many ways to do so. Smile | :)
 
—SA
  Permalink  
Comments
Abhinav S at 14-Feb-12 3:10am
   
5!
SAKryukov at 14-Feb-12 3:28am
   
Easy reading, right? :-)
Thank you, Abhinav.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

example of a form.
 
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
 
            Button button1 = new Button();
            button1.Text = "Click Me";
            button1.Click += new System.EventHandler(this.button1_Click);
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
 
            Form f = new Form();
            f.Closed += new EventHandler(f_Closed);
            f.Show();
        }
 
        void f_Closed(object sender, EventArgs e)
        {
            this.Show();
        }
    }
  Permalink  
Comments
SAKryukov at 14-Feb-12 3:02am
   
Well, basically... I voted 4. You should not violate naming conventions; all auto-generated names should be gives semantic names, "f_Close" is redundant -- anonymous method is recommended. Not bad, anyway.
--SA
Michael dg at 14-Feb-12 10:01am
   
thank you for the feedback. Next time I will try to follow the coding convention. :)
Abhinav S at 14-Feb-12 3:10am
   
My 5.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 344
1 Nirav Prabtani 252
2 Abhinav S 220
3 Dave Kreskowiak 155
4 Pikoh 140
0 OriginalGriff 7,545
1 Sergey Alexandrovich Kryukov 6,757
2 Maciej Los 3,909
3 Peter Leow 3,693
4 CHill60 2,712


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 14 Feb 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