Esempio n. 1
0
        /// <summary>
        /// 鼠标移到运行的位置。
        /// </summary>
        private void MouseMove2RunMidPosition()
        {
            //最小化 无控件位置和控件Width Height 待优化
            Dispatcher.Invoke(new Action(() => {
                //do something here
                pt = RunBtn.PointToScreen(new System.Windows.Point(0, 0));

                if (pt.X > 0 && pt.Y > 0 &&
                    pt.X <= SystemParameters.PrimaryScreenWidth &&
                    pt.Y <= SystemParameters.PrimaryScreenHeight)
                {
                    SetCursorPos((int)pt.X + (int)RunBtn.Width / 2, (int)pt.Y + (int)RunBtn.Height / 2);
                }
            }));
        }
 public void DisplayUser(bool b)
 {
     if (b)
     {
         RunBtn.Show();
         UserInput.Show();
         AutoBtn.Show();
         ClearBtn.Show();
     }
     else
     {
         ClearBtn.Hide();
         RunBtn.Hide();
         UserInput.Hide();
         AutoBtn.Hide();
     }
 }
Esempio n. 3
0
        private void LaunchThread_Click(object sender, EventArgs e)
        {
            if (m_WorkerThread == null)
            {
                RunBtn.Text = "GO";
            }

            if (RunBtn.Text == "GO")     // on lance le thread
            {
                RunBtn.Text = "STOP";
                RunBtn.Update();

                listView1.Items.Clear();

                // reset events
                m_EventStopThread.Reset();
                m_EventThreadStopped.Reset();

                configBoxText = this.ConfigBox.Text;
                pathBoxText   = this.PathBox.Text;

                // create worker thread instance
                m_WorkerThread = new Thread(new ThreadStart(this.WorkerThreadFunction));

                m_WorkerThread.Name = "Worker Thread Config Lua";       // looks nice in Output window

                m_WorkerThread.Start();
            }
            else
            if (RunBtn.Text == "STOP")     // on stop le thread
            {
                RunBtn.Text = "GO";

                StopThread();
            }
        }