private void listBox_notifi_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.listBox_notifi.IndexFromPoint(e.Location); listBox_notifi.SelectedIndex = index; if (index != System.Windows.Forms.ListBox.NoMatches) { chat_online newchat = new chat_online(id, Read_temp(listBox_notifi.SelectedItem + ""), true, true); newchat.Show(); } }
private void online_stu_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.online_stu.IndexFromPoint(e.Location); online_stu.SelectedIndex = index; if (index != System.Windows.Forms.ListBox.NoMatches) { chat_online newchat = new chat_online(id, name_id["" + online_stu.SelectedItem + ""], false, false); newchat.Show(); } }
private void button_talk_Click(object sender, EventArgs e) { if (online_stu.SelectedIndex != -1) { chat_online newchat = new chat_online(id, name_id["" + online_stu.SelectedItem + ""], false, false); //newchat.Text = online_stu.SelectedItems+""; newchat.Show(); } else { MessageBox.Show("请先在[当前在线]中选择一个对话者"); } }