示例#1
0
        private void open_shpfile_Click(object sender, EventArgs e) //    打开shpfile文件
        {
            if (readnum == 0)                                       //全部初始化
            {
                shp1          = new shpfile();
                shp2          = new shpfile();
                dis_result[0] = null;
                dis_result    = new discriminant_result[5];
                all_rangeX.Clear();
                all_rangeY.Clear();
                checkedListBox1.SetItemChecked(0, true);
                checkedListBox1.SetItemChecked(1, true);
                pictureBox1.BackgroundImage = new Bitmap(835, 470);
                REPORT_show.Text            = "";
            }
            ;
            try
            {
                OpenFileDialog opf = new OpenFileDialog();
                opf.InitialDirectory = Path;

                opf.Title = "请选择导入shp文件";

                opf.Filter = "(*.shp)|*.shp";
                status_text("玩命加载中   请稍等……", Color.Black);
                if (opf.ShowDialog() == DialogResult.OK)
                {
                    string shppath = opf.FileName;
                    if (readnum == 0)
                    {
                        readshp(shppath, shp1);
                        DATAshow(DATA_shpLine1, shp1);                     //显示读取的数据
                        DATA_shpLine2.Rows.Clear();
                        status_text("成功读取第一个shpfile文件", Color.Black);
                        readnum = 1;
                    }
                    else
                    {
                        readshp(shppath, shp2);
                        DATAshow(DATA_shpLine2, shp2);                          //显示读取的数据
                        status_text("成功读取第二个shpfile文件", Color.Black);
                        readnum = 0;
                    }
                    DATA_show.BringToFront();
                }
            }
            catch { MessageBox.Show("程序错误"); }
        }
示例#2
0
 private void DATA_window_Click(object sender, EventArgs e)             //打开数据窗口
 {
     DATA_show.BringToFront();
     status_text("数据窗口显示", Color.Black);
 }