private void lsvOnline_DoubleClick(object sender, EventArgs e) { ListView lsv = (ListView)sender; var SelectedItem = lsv.SelectedItems[0]; var user = (UserClient)SelectedItem.Tag; if (!fInboxs.ContainsKey(user.Username)) { fInbox inbox = new fInbox(Program.User, user); fInboxs.Add(user.Username, inbox); inbox.FormClosed += Inbox_FormClosed; inbox.Show(); } fInboxs[user.Username].WindowState = FormWindowState.Normal; }
private void Inbox_FormClosed(object sender, FormClosedEventArgs e) { fInbox f = (fInbox)sender; fInboxs.Remove(f.Partner.Username); }