private void onlineUsers_DoubleClick(object sender, EventArgs e) { String user = onlineUsers.SelectedItem.ToString(); if (!privateWindows.Contains(user)) { PrivateChat window = new PrivateChat(myIp, user, swSender); privateWindows.Add(user, window); } try { ((PrivateChat)privateWindows[user]).recievedMessage(""); } catch { privateWindows.Remove(user); PrivateChat window = new PrivateChat(myIp, user, swSender); privateWindows.Add(user, window); ((PrivateChat)privateWindows[user]).Show(); } }