예제 #1
0
 private void tabControlMain_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (statusStrip1.Items.Count > 0 && tabControlMain.TabCount > 0)
     {
         CtrlDataGridView gridViewRowCount = (CtrlDataGridView)tabControlMain.TabPages[tabControlMain.SelectedIndex].Controls[0];
         statusStrip1.Items[0].Text = " 共有 " + gridViewRowCount.countLog + " 条记录";
     }
 }
예제 #2
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItems.Count <= 0)
            {
                MessageBox.Show("没有选择管线图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            list = CollisionAnalysis();
            if (list.Count < 0)
            {
                MessageBox.Show("没有选择管线图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            bool bl = false;

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].Rows.Count > 0)
                {
                    bl = true;
                }
            }
            if (!bl)
            {
                MessageBox.Show("没有发生碰撞的管线!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            tabControlMain.TabPages.Clear();
            for (int i = 0; i < list.Count; i++)
            {
                GSOLayer layer1 = globeControl1.Globe.Layers.GetLayerByCaption(listBox1.SelectedItems[i].ToString().Trim());
                AddNewCtrlPage(new CtrlDataGridView(globeControl1, layer1, list[i]), layer1.ID.ToString(), layer1.Caption);
            }
            if (statusStrip1.Items.Count > 0 && tabControlMain.TabCount > 0)
            {
                tabControlMain.SelectedIndex = 0;
                CtrlDataGridView gridViewRowCount = (CtrlDataGridView)tabControlMain.TabPages[tabControlMain.SelectedIndex].Controls[0];

                statusStrip1.Items[0].Text = " 共有 " + gridViewRowCount.countLog + " 条记录";
            }
            globeControl1.Globe.Refresh();
        }