private void button1_Click_1(object sender, EventArgs e) { EditUser editUser = new EditUser(users, null); editUser.ShowDialog(); LoadData(); }
private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { if (listBox1.SelectedItem == null) { MessageBox.Show("请先选中要修改的用户"); return; } string selectedItem = (string)listBox1.SelectedItem; string [] items = selectedItem.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); User user = new User(items[1], items[2], items[0].Equals("管理员")); EditUser editUser = new EditUser(users, user); editUser.ShowDialog(); LoadData(); }