private void button15_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < checkedListBox22.Items.Count; i++)
            {
                if (checkedListBox22.GetItemChecked(i))
                {
                    checkedListBox2.SetItemChecked(i, true);
                }
                else
                {
                    checkedListBox2.SetItemChecked(i, false);
                }
            }

            //try
            //{
            string name = "";

            foreach (string names in checkedListBox2.CheckedItems)
            {
                name += names;
            }
            //读取武功
            string  midname = Convert.ToString(al[50]);
            loaddat ld      = new loaddat();

            kungfuwear kw = new kungfuwear();

            kw.kfoff(al, ld.loadkungfu(midname));
            ArrayList kf = new ArrayList();

            kf = ld.loadkungfu(name);
            for (int i = 200; i < 400; i++)
            {
                if (Convert.ToString(al[i]) == name)
                {
                    if (Convert.ToString(kf[12]) == "def")
                    {
                        kw.kfwear(al, kf);
                    }
                    else
                    {
                        MessageBox.Show("所选武功不是心法。");
                    }
                    break;
                }
            }
            f5();
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("你没有学习这个武功或者没有选择!");
            //}
        }
        private void button14_Click(object sender, EventArgs e)
        {
            //解除内功
            string     midname = Convert.ToString(al[50]);
            loaddat    ld      = new loaddat();
            kungfuwear kw      = new kungfuwear();

            kw.kfoff(al, ld.loadkungfu(midname));

            f5();
        }
示例#3
0
        private void button10_Click(object sender, EventArgs e)
        {
            string name = "";

            name = textBox50.Text;

            //读取武功
            string  midname = Convert.ToString(al[50]);
            loaddat ld      = new loaddat();

            kungfuwear kw = new kungfuwear();

            kw.kfoff(al, ld.loadkungfu(midname));
            ArrayList kf = new ArrayList();

            kf      = ld.loadkungfu(name);
            al[200] = textBox50.Text;
            al[400] = textBox51.Text;
            for (int i = 200; i < 400; i++)
            {
                if (Convert.ToString(al[i]) == name)
                {
                    if (Convert.ToString(kf[12]) == "def")
                    {
                        kw.kfwear(al, kf);
                    }
                    else
                    {
                        MessageBox.Show("所选武功不是心法。");
                    }
                    break;
                }
            }
            f5();
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("你没有学习这个武功或者没有选择!");
            //}
        }