Exemplo n.º 1
0
        //Point ppp = new Point();
        //声明委托参数,[0]位存放委托方法的第一个参数,[1]位存放委托方法的第二个参数

        public MainWindow()
        {
            InitializeComponent();
            //invokeBGData[0] = this;//定义[0]位参数位需要更新的Chart控件
            //invokeBGData[1] = 1;//定义[1]位为Chart中的数据
            invokeBGData[0] = backgrid;
            invokeBGData[1] = 0.0;

            Thread thread = new Thread(UpdateGrid);

            thread.IsBackground = true;
            thread.Start();
            answin = new WinAns();
            //backgrid.Background =
        }
Exemplo n.º 2
0
        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                //Point down_p = new Point(Cursor.Position.X, Cursor.Position.Y);
                //Point pp = Mouse.GetPosition(e.Source as FrameworkElement);//WPF方法
                //ppp = (e.Source as FrameworkElement).PointToScreen(pp);//WPF方法
                this.DragMove();

                //backgrid.Background = im;

                if (answin == null)
                {
                    answin = new WinAns();
                }
                if (showflag)
                {
                    answin.Left = this.Left + this.Width;
                    answin.Top  = this.Top;
                    answin.Show();
                    answin.Topmost = true;
                }
            }
        }