private void Form1_Load(object sender, EventArgs e) { _obj = this; ConnectScreen cs = new ConnectScreen(); panelMain.Controls.Add(cs); }
private void buttonLogout_Click(object sender, EventArgs e) { listBoxFiles.Items.Clear(); Messages.sendMessage(Form1.Instance.connection, new string[] { "EXIT" }); Size size = new Size(416, 339); f.Size = size; ConnectScreen c = new ConnectScreen(); c.Dock = DockStyle.Fill; Form1.Instance.panel.Controls.Add(c); Form1.Instance.panel.Controls["ConnectScreen"].BringToFront(); }