private void createPrivateForm(String neckname) { PrivateForm pf = new PrivateForm(); pf.Text = neckname; privateChatForms.Add(neckname, pf); pf.Show(); }
private void lsb_friends_MouseDoubleClick(object sender, MouseEventArgs e) { if(lsb_friends.SelectedItem == null ||lsb_friends.SelectedItem.ToString() == null) { return; } String chatNeck = lsb_friends.SelectedItem.ToString(); if (privateChatForms.Keys.Contains(chatNeck)) { privateChatForms[chatNeck].BringToFront(); } else { PrivateForm pf = new PrivateForm(); pf.Text = chatNeck; privateChatForms.Add(chatNeck, pf); pf.Show(); } }