Example #1
0
        private void enlarge_Click(object sender, RoutedEventArgs e) //放大
        {
            NUM -= (int)(NUM * R);                                   //最终单元格个数

            if (NUM < 2)
            {
                NUM = 2;//锁定单元格下限为2
                return;
            }

            stackPanel_XySys.Children.Remove(mySys);//重绘坐标系
            xySys xysys = new xySys();

            mySys = xysys.createSys(_WH_CANVAS, NUM, SYSMODE);
            stackPanel_XySys.Children.Add(mySys);
            if (X_DOT == -1 || Y_DOT == -1)//文本框空时,不再执行描点操作
            {
                return;
            }

            stackPanel_XySys.Children.Remove(mySys);//描点
            xySysCtrl sysCtrl = new xySysCtrl();

            mySys = sysCtrl.drawDot(true);
            stackPanel_XySys.Children.Add(mySys);
        }
Example #2
0
        private void drawDot_Click(object sender, RoutedEventArgs e) //描点
        {
            if (x_TxtBox.Text == "" || y_TxtBox.Text == "")          //文本框值为空则返回
            {
                stackPanel_XySys.Children.Remove(mySys);             //重绘坐标系
                xySys tmpCanvas = new xySys();
                mySys = tmpCanvas.createSys(_WH_CANVAS, NUM, SYSMODE);
                stackPanel_XySys.Children.Add(mySys);

                return;
            }

            X_DOT = int.Parse(x_TxtBox.Text);
            Y_DOT = int.Parse(y_TxtBox.Text);

            //坐标系上描点
            stackPanel_XySys.Children.Remove(mySys);
            xySysCtrl sysCtrl   = new xySysCtrl();
            Canvas    newCanvas = sysCtrl.drawDot(true);

            mySys = newCanvas;
            stackPanel_XySys.Children.Add(mySys);
        }