private void 除ToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "确定要移除当前配置么?", "WEF数据库工具", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { string stringid = Treeview.SelectedNode.Tag.ToString(); UtilsHelper.DeleteConnection(stringid); Connection tempconn = _ConnectList.Find(delegate(Connection conn) { return(conn.ID.ToString().Equals(stringid)); }); if (null != tempconn) { _ConnectList.Remove(tempconn); } Treeview.Nodes.Remove(Treeview.SelectedNode); } }