private void btnYes_Click(object sender, EventArgs e)
 {
     b = 0;
     this.btnYes.Visible    = false;
     this.btnYes.Enabled    = false;
     this.btnInst.Enabled   = false;
     this.btnInst.Visible   = false;
     this.gamePause.Visible = false;
     this.gamePause.Enabled = false;
     this.winGame.Visible   = false;
     this.winGame.Enabled   = false;
     this.Level1.Visible    = false;
     this.Level1.Enabled    = false;
     this.Level2.Visible    = false;
     this.Level2.Enabled    = false;
     this.Level3.Visible    = false;
     this.Level3.Enabled    = false;
     this.label1.Visible    = false;
     this.label1.Enabled    = false;
     this.label2.Visible    = false;
     this.label2.Enabled    = false;
     this.label3.Visible    = false;
     this.label3.Enabled    = false;
     this.label4.Visible    = false;
     this.label4.Enabled    = false;
     Timer1.Stop();
     Timer.Start();
 }
Beispiel #2
0
        private void GameOver()
        {
            trophy.Visible = true;

            Timer1.Stop();

            Start.Enabled = true;

            explosion.Visible = true;
            player.Controls.Add(explosion);
            explosion.Location  = new Point(-8, 5);
            explosion.BackColor = Color.Transparent;
            explosion.BringToFront();

            if (Score < 1000)
            {
                trophy.Image = Properties.Resources.bronze;
            }
            if (Score > 2500)
            {
                trophy.Image = Properties.Resources.silver;
            }
            if (Score > 3500)
            {
                trophy.Image = Properties.Resources.gold;
            }
            backgroundWorker2.RunWorkerAsync();
        }
Beispiel #3
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     if (CheckTheAnswer())
     {
         Timer1.Stop();
         MessageBox.Show("Все ответы правильные!", "Ох");
         StartButton.Enabled = true;
     }
     else if (timeLeft > 0)
     {
         timeLeft      -= 1;
         TimeLabel.Text = timeLeft + " секунд";
         if (timeLeft == 5)
         {
             TimeLabel.BackColor = Color.Red;
         }
     }
     else
     {
         Timer1.Stop();
         TimeLabel.Text = "Время вышло";
         MessageBox.Show("Вы не уложились по времени", "Ох");
         Sum.Value           = AddEnd1 + AddEnd2;
         Difference.Value    = minuend - subtrahend;
         Product.Value       = multiplicand * multiplier;
         Quotient.Value      = dividend / divisor;
         TimeLabel.BackColor = Color.Empty;
         StartButton.Enabled = true;
     }
 }
 private void MoveBall(ref int xChange, ref int yChange)
 {
     if (x <= 0)
     {
         xChange = xChange * -1;
     }
     if (x >= (Panel1.Width - diameter))
     {
         xChange = xChange * -1;
     }
     if (y <= 0)
     {
         yChange = yChange * -1;
     }
     if (y >= (Panel1.Height - diameter))
     {
         yChange = yChange * -1;
     }
     // laat bal verdwijnen in hole
     if (((x - holeX) >= 0) && ((x - holeX) <= 8) && ((y - holeY) >= 0) && ((y - holeY) <= 8))
     {
         Timer1.Stop();
         DrawBall(holeX, holeY, holeX, holeY, diameter, Color.DarkGreen, Color.DarkGreen);
     }
     // Om bal in hole te zien gaan, verklein Panel1 of versnel timer
     oudeX = x;
     oudeY = y;
     x     = x + xChange;
     y     = y + yChange;
 }
Beispiel #5
0
 private void backward_MouseUp(object sender, MouseEventArgs e)
 {
     this.Back           = false;
     this.Timer1.Enabled = false;
     Timer1.Stop();
     Timer1.Interval = 100;
 }
        ////*
        public void Timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                //Read and display actual position


                posTextBox.Text = Convert.ToString(xAxisAmp.PositionActual);
                VeltextBox.Text = Convert.ToString(xAxisAmp.VelocityActual);
                CurtextBox.Text = Convert.ToString(xAxisAmp.CurrentActual);
                //send position data


                //frm.frm1 = this;


                //btnSend();
                if (_point < 50)
                {
                    chart1.Series[0].Points.Add(xAxisAmp.PositionActual);
                }
                else
                {
                    chart1.Series[0].Points.RemoveAt(0);
                    chart1.Series[0].Points.Add(xAxisAmp.PositionActual);
                }
            }
            catch (Exception ex)
            {
                Timer1.Stop();
                DisplayError(ex);
            }
        }
Beispiel #7
0
        public void player(bool p_popal, bool e_popal)
        {
            if (p_popal)
            {
                money++;         //Если попал игрок во врага, добавляем очко
            }
            if (e_popal)
            {
                money--;         //Если попал враг в игрока, отнимаем очко
            }
            #region Сообщение о победе или проигрыше
            if (money == mneed)
            {
                MessageBox.Show("You win", "Yup", MessageBoxButtons.RetryCancel); bshot_timer.Stop(); shot_timer.Stop(); Timer1.Stop(); tshot_timer.Stop();
            }
            else if (money == 0)
            {
                bshot_timer.Stop();
                shot_timer.Stop();
                Timer1.Stop();
                tshot_timer.Stop();

                MessageBox.Show("You won", "ohh", MessageBoxButtons.RetryCancel);
            }
            #endregion

            lbl.Text = "Счет: " + money;//Вывод счета на экран
        }
Beispiel #8
0
 public void Timer1_Tick(object sender, EventArgs e)
 {
     pgbLoadData.Increment(1);
     if (pgbLoadData.Value == 50)
     {
         var            sqlReserveFoodDetailData = "Select FoodID, foodAmount, foodPrice from tb_reserveFood where reserveID='" + System.Convert.ToString(dgvReserveBoat.Rows[dgvReserveBoat.CurrentRow.Index].Cells[0].Value) + "'";
         DataTable      dt         = new DataTable();
         string         foodID     = "";
         string         foodAmount = "";
         string         foodPrice  = "";
         SqlDataAdapter da         = new SqlDataAdapter(sqlReserveFoodDetailData, ConstVar.connect.DatabaseConnection(ConstVar.constr));
         da.Fill(dt);
         foreach (DataRow row in dt.Rows)
         {
             foodID     = System.Convert.ToString(row["foodID"]);
             foodAmount = System.Convert.ToString(row["foodAmount"]);
             foodPrice  = System.Convert.ToString(row["foodPrice"]);
             string selldetailID           = ConstVar.au.SetID(ConstVar.constr, "SellDetailID", "tb_SellDetail", "", 0, 10, 10, "0000000000");
             string sqlConverDataToSelling = "insert into tb_SellDetail values('" + selldetailID + "','" + tempID + "','" + foodID + "','" + foodPrice + "','" + foodAmount + "')";
             ConstVar.sav.Insert(sqlConverDataToSelling, ConstVar.connect.DatabaseConnection(ConstVar.constr));
         }
     }
     else if (pgbLoadData.Value == 100)
     {
         Timer1.Stop();
         //  sh.ShowData("select * from v_Reserve3 where [ສະຖານະ] =N'ຢືນຢັນແລ້ວ'", connect.DatabaseConnection(constr), dgvReserveBoat)
         ConstVar.sh.ShowData("select * from v_reserve3 where [ວັນທີ່ຈະມາ] = convert(varchar(10),getdate(), 101) and [ສະຖານະ] =N'ຢືນຢັນແລ້ວ'", ConstVar.connect.DatabaseConnection(ConstVar.constr), dgvReserveBoat);
         pgbLoadData.Visible = false;
         ButtonX1.Text       = "ສໍາເລັດ";
     }
 }
Beispiel #9
0
 private void BtnSifirla_Click(object sender, EventArgs e)
 {
     Timer1.Stop();
     Timer1.Dispose();
     LBLSure.Text = @"00:00:00";
     MtbSaat.Text = "";
 }
Beispiel #10
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (Timer1.Interval >= 300 & Timer1.Interval < 600)
     {
         Timer1.Stop();
         getMatchingUnits();
     }
 }
Beispiel #11
0
        private void Button2_Click(object sender, EventArgs e)
        {
            AddLog("STOP...!");
            StartBtn.Enabled = true;
            StopBtn.Enabled  = false;

            Timer1.Stop();
        }
Beispiel #12
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     Panel1.Width += 20;
     if (Panel1.Width >= 400)
     {
         Timer1.Stop();
     }
 }
Beispiel #13
0
 //啟動遊戲
 private void GO_Click(object sender, EventArgs e)
 {
     Timer1.Stop();
     Q.Left = 209;
     Q.Top  = 224;
     Q.Tag  = new Point(5, -5); //預設速度(往右上)
     Timer1.Start();            //開始移動
 }
Beispiel #14
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     if (Timer1.Interval >= 300 & Timer1.Interval < 600)
     {
         Timer1.Stop();
         getMatchBooking();
     }
 }
Beispiel #15
0
        private void Timer1_Tick(object sender, EventArgs e) // Metodo del Timer al dar un Tick
        {
            Timer1.Stop();                                   // El timer se detendra
            primerclick.ForeColor  = primerclick.BackColor;  // Asignacion de color al primer click se le asignara el color de fondo que contenga el primer click
            segundoclick.ForeColor = segundoclick.BackColor; // Asignacion de color al segundo click se le asignara el color de fondo que contenga el segundo click

            primerclick  = null;                             // Primer click igual a null
            segundoclick = null;                             // Segundo click igual a null
        }
Beispiel #16
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     contador += 1;
     if (contador == 40)
     {
         Timer1.Stop();
         comprobar_conexiones();
     }
 }
Beispiel #17
0
        private void btnCancelNode_Click(object sender, EventArgs e)
        {
            MapWindow open = new MapWindow();

            Destinations.Dest.Clear();
            Timer1.Stop();
            open.ShowDialog();
            Close();
            Dispose();
        }
Beispiel #18
0
 public void Pause_Time()
 {
     if (Timer1 == null)
     {
         MessageBox.Show("NULL");
         return;
     }
     Timer1.Stop();
     Timer2.Stop();
 }
 //Event tick của panel chứa control thao tác dữ liệu
 private void Timer1_Tick(object sender, EventArgs e)
 {
     //SPanel_Sliding
     IsDone = false;
     if (Hidden)
     {
         if (IsFinished)
         {
             IsIncreased    = true;
             IsDone         = true;
             SPanel.Height += 10;
             if (SPanel.Height >= panelHeight * 2)
             {
                 Timer1.Stop();
                 Hidden = false;
                 this.Update();
                 IsFinished      = false;
                 tButton.Enabled = true;
             }
         }
     }
     else
     {
         IsIncreased    = false;
         IsDone         = true;
         SPanel.Height -= 10;
         if (SPanel.Height <= 0)
         {
             Timer1.Stop();
             Hidden = true;
             this.Update();
             IsFinished = true;
         }
     }
     //MPanel_Sliding
     if (IsDone)
     {
         if (IsIncreased)
         {
             tMeaning.Height -= 10;
             if (tMeaning.Height >= ((rtbHeight - panelHeight * 2)))
             {
                 this.Update();
             }
         }
         else
         {
             tMeaning.Height += 10;
             if (tMeaning.Height <= rtbHeight)
             {
                 this.Update();
             }
         }
     }
 }
 // Timer1
 void Timer1_Tick(object sender, EventArgs e)
 {
     if (Top < 0)
     {
         Top++;
     }
     else
     {
         Timer1.Stop();
     }
 }
 public void Timer1_Tick(object sender, EventArgs e)
 {
     if (Panel2.Height <= 200)
     {
         Panel2.Height = Panel2.Height + 10;
     }
     else
     {
         Timer1.Stop();
     }
 }
Beispiel #22
0
 private void ButtonDc_Click(object sender, EventArgs e)
 {
     if (SerialPortBt.IsOpen)
     {
         SerialPortBt.Close();
     }
     Timer1.Stop();
     LabelIsConn.Text        = "Brak Połączenia";
     ToolStripLabelPort.Text = "Port: Brak";
     IsConnected             = false;
 }
Beispiel #23
0
 //Huỳnh Viết Thám
 //Các thao tác thực hiện sau mỗi lần thời gian 2 tick
 private void Timer2_Tick(object sender, EventArgs e)
 {
     player[1].time--;
     lbTime2.Text = string.Format("{0:00}:{1:00}", player[1].time / 60, player[1].time % 60);
     if (player[1].time == 0)
     {
         Timer1.Stop();
         Timer2.Stop();
         MessageBox.Show("Time out! You still can continue, but time will be stuck at 00:00!", "Chess ITUS Time Notification", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #24
0
 private void Check_End_Time()
 {
     if (Minute == 0 && Second == 0)
     {
         Play_Sub_Horn();
         Timer1.Stop();
         Timer2.Stop();
         Reset_Timer1();
         Reset_Timer2();
     }
 }
Beispiel #25
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     ProgressBar1.Increment(1);
     if (ProgressBar1.Value == ProgressBar1.Maximum)
     {
         frmLogin oFrmLogin = new frmLogin(oLogin);
         oFrmLogin.Show();
         this.Hide();
         Timer1.Stop();
     }
 }
Beispiel #26
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     try
     {
         Timer1.Stop();
         i = 0;
     }
     catch (Exception)
     {
     }
 }
Beispiel #27
0
 private void Button2_Click(object sender, EventArgs e)
 {
     if (Timer1.Enabled == false)
     {
         MessageBox.Show("Spammen is al gestopt", "Error");
     }
     else
     {
         Timer1.Stop();
         MessageBox.Show("Spammen is gestopt", "Gestopt");
     }
 }
Beispiel #28
0
 private void CheckBoxRaceMode_CheckStateChanged(object sender, EventArgs e)
 {
     RaceMode = CheckBoxRaceMode.Checked;
     if (CheckBoxRaceMode.Checked)
     {
         Timer1.Stop();
     }
     else
     {
         Timer1.Start();
     }
 }
Beispiel #29
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     contador += 1;
     if (contador == 30)
     {
     }
     else if (contador == 32)
     {
         Timer1.Stop();
         Dispose();
         Buscar_servidores.DefaultInstance.ShowDialog();
     }
 }
Beispiel #30
0
        /// <summary>
        /// Tạo một thể hiện mới với các tham số được truyền vào
        /// </summary>
        /// <param name="frm">Form chứa Border này</param>
        /// <param name="backcolor">màu nền của Border</param>
        /// <param name="textcolor">Màu chữ tiêu đề của Border</param>
        /// <param name="textsize">Kích thước chữ tiêu đề của Border</param>
        /// <param name="controlmoveable">Các control có thể được di chuyển như Border khi dùng Border này</param>
        public Border(Form frm, Color backcolor, Color textcolor, bool backgroundMoveable, bool resizeable)
        {
            _frm = frm;
            _frm.FormBorderStyle = FormBorderStyle.None;
            BackgroundMoveable   = backgroundMoveable;
            Resizeable           = resizeable;

            AddFormMoveableControls(this, Title);

            InitializeComponent(backcolor, textcolor);

            // add event to control
            frm.MouseMove += delegate(object sender, MouseEventArgs e)
            {
                if (e.Y < Height / 2)
                {
                    Timer1.Start();
                    Timer2.Stop();
                }
                else
                {
                    Timer2.Start();
                    Timer1.Stop();
                }
            };

            frm.SizeChanged += delegate(object sender, EventArgs e)
            {
                this.Width               = frm.Width;
                CloseBox.Location        = new Point(Width - CloseBox.Width, 0);
                NormnalBox.Location      = new Point(Width - NormnalBox.Width * 2, 0);
                MiniBox.Location         = new Point(Width - MiniBox.Width * 3, 0);
                OpacityTrackbar.Location = new Point(MiniBox.Left - OpacityTrackbar.Width - 5, 2);
                Title.Width              = OpacityTrackbar.Left;
                frm.Refresh();
            };

            frm.Paint += delegate(object sender, PaintEventArgs e)
            {
                e.Graphics.DrawRectangle(new Pen(Title.BackColor), new Rectangle(0, 0, frm.Width - 1, frm.Height - 1));
            };


            Controls.Add(Title);
            Controls.Add(OpacityTrackbar);
            Controls.Add(MiniBox);
            Controls.Add(NormnalBox);
            Controls.Add(CloseBox);
            frm.Controls.Add(this);
            this.BringToFront();
        }