标题:?? 不能再form中显示?
只看楼主
需要指点
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-9-14
结帖率:100%
 问题点数:0 回复次数:1 
?? 不能再form中显示?
程序代码:
namespace 数据排序
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Activated(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox1.Focus();
            label1.Text = "please input:" + (Form1.i + 1) + "geshu";

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form1.num[Form1.i] = int.Parse(textBox1.Text);
        }
    }
}namespace 数据排序
{
    public partial class Form1 : Form
    {

        public static int[] num = new int[10];
        public static int i;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frm2 = new Form2();
            for (int i = 0; i < 10; )
            {
                if (DialogResult.OK == frm2.ShowDialog())
                    i++;

            }
            label1.Text += " the num is \n\n\n";
            for (i = 0; i < 10; i++)
                label1.Text += num[i] + " ";
            int tempt = num[0];
            for (i = 0; i <= 10; i++)
            {
                for (int j = i + 1; j < 10; j++)
                {
                    if (num[i] > num[j])
                    {
                        tempt = num[i];
                        num[i] = num[j];
                        num[j] = tempt;
                    }





                }
            }
            for (i = 0; i <= 10; i++)
                label1.Text += num[i] + " ";
        }
    }
}
2012-09-21 17:25
枫叶离开树
Rank: 2
等 级:论坛游民
帖 子:17
专家分:72
注 册:2012-10-1
得分:0 
编译器告诉你什么错误。。。
2012-10-01 00:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-381830-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.052903 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved