예제 #1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            ArrayList    tempArr = getChangeUserControl();
            UserControl1 uc      = null;
            VerifyEntity ve      = null;

            for (int i = 0; i < tempArr.Count; i++)
            {
                uc      = (UserControl1)tempArr[i];
                ve      = (VerifyEntity)ConfigStore.codeTable[uc.GetAttr1()];
                ve.Code = uc.GetText();
                uc.SetChange(false);
                uc.SetChecked(false);
            }
            tempArr.Clear();
            tempArr = null;
            MessageBox.Show(Program.mainForm, "保存成功!");
        }
예제 #2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_del_Click(object sender, EventArgs e)
        {
            DialogResult dr;

            dr = MessageBox.Show(Program.mainForm, "您确定要删除选择的项吗(" + textBox1.Text + ")?", "删除提醒", MessageBoxButtons.YesNoCancel,
                                 MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
            if (dr != DialogResult.Yes)
            {
                return;
            }

            UserControl1 uc      = null;
            ArrayList    tempArr = getCheckedUserControl();

            for (int i = 0; i < tempArr.Count; i++)
            {
                uc = (UserControl1)tempArr[i];
                flowLayoutPanel1.Controls.Remove(uc);
                ConfigStore.codeTable.Remove(uc.GetAttr1());
            }
            tempArr.Clear();
            tempArr = null;
        }