Click here to Skip to main content
12,394,978 members (63,073 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: .NET3.5 C# .NET 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 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 14-Feb-12 3:10am
   
5!
SAKryukov 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 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 14-Feb-12 10:01am
   
thank you for the feedback. Next time I will try to follow the coding convention. :)
Abhinav S 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 14 Feb 2012
Copyright © CodeProject, 1999-2016
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