How to make the main form created by Visual Studio stay invisible after opening another? I tried using the "hide ();" command, but I did not succeed.
code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2();
f.Show();
// no caso ao abrir o Form2, o Form1 ficar invisivel.
}
}
}