Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            BtnEdit.SetIcon(global::CarSensX.Properties.Resources.iconEdit);
            BtnFullScreen.SetIcon(global::CarSensX.Properties.Resources.iconFullScreen);
            BtnExit.SetIcon(global::CarSensX.Properties.Resources.iconBack);

            BtnExit.SetLabel("Exit");
            BtnFullScreen.SetLabel("Fullscreen");
            BtnEdit.SetLabel("Configure");
            BtnBackground.SetLabel("Set Background");

            BtnEdit.MouseLeftButtonUp       += new MouseButtonEventHandler(BtnEditClick);
            BtnFullScreen.MouseLeftButtonUp += new MouseButtonEventHandler(BtnFullScreenClick);
            BtnBackground.MouseLeftButtonUp += new MouseButtonEventHandler(BtnBackgroundClick);
            BtnExit.MouseLeftButtonUp       += new MouseButtonEventHandler(BtnExitClick);

            if (global::CarSensX.Properties.Settings.Default.BackgroundImage != null)
            {
                String fileName = global::CarSensX.Properties.Settings.Default.BackgroundImage;
                try
                {
                    BitmapImage iSource = new BitmapImage(new Uri(fileName));
                    BackgroundGrid.Background = new ImageBrush(iSource);
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 2
0
        private void FrmKOT_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && ActiveControl != Grid)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (TxtGridWaiter.Visible == true || TxtGridUsedNo.Visible == true)
                {
                    _GridControlMode = false;
                    GridControlMode(false);
                    _GridControlMode = true;
                    Grid.Focus();
                }
                else if (BtnCancel.Enabled == true)
                {
                    this.Tag = "";
                    BtnCancel.PerformClick();
                }
                else if (BtnCancel.Enabled == false)
                {
                    BtnExit.PerformClick();
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 3
0
        private void FrmGodownTransfer_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && ActiveControl != Grid)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (TxtGridProductList.Visible == true)
                {
                    //GridControlMode(false);
                    Grid.Focus();
                }
                else if (BtnCancel.Enabled == true)
                {
                    _Tag         = "";
                    TxtDate.Text = "";
                    BtnCancel.PerformClick();
                }
                else if (BtnCancel.Enabled == false)
                {
                    BtnExit.PerformClick();
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 4
0
        private void FrmPurchaseIndent_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && ActiveControl != Grid)
            {
                SendKeys.Send("{Tab}");
                ActiveControl.Select();
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (TxtGridParticular.Visible == true)
                {
                    _GridControlMode = false;
                    GridControlMode(false);
                    _GridControlMode = true;
                    Grid.Focus();
                }
                else if (BtnCancel.Enabled == true)
                {
                    _Tag         = "";
                    TxtDate.Text = "";
                    BtnCancel.PerformClick();
                }
                else if (BtnCancel.Enabled == false)
                {
                    BtnExit.PerformClick();
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 5
0
        private void FrmUdfMaster_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && this.ActiveControl != GridList)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (TxtListDescription.Visible == true)
                {
                    GridControlMode(false);
                    GridList.Focus();
                }
                else if (BtnCancel.Enabled == true)
                {
                    this.Tag = "";
                    BtnCancel.PerformClick();
                }
                else if (BtnCancel.Enabled == false)
                {
                    BtnExit.PerformClick();
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 6
0
        // Exit Buttons
        private void Btn_Exit_Buttons_Click(object sender, EventArgs e)
        {
            switch ((sender as Button).Name)
            {
            case "BtnIgen":
                Close();
                break;

            case "BtnNem":
                PanelExit.Hide();
                BtnExit.Show();
                break;
            }
        }
Exemplo n.º 7
0
 private void FrmMenuPermissionGroup_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         if (BtnCancel.Enabled == true)
         {
             _Tag = "";
             BtnCancel.PerformClick();
         }
         else
         {
             BtnExit.PerformClick();
         }
         DialogResult = DialogResult.Cancel;
         return;
     }
 }
Exemplo n.º 8
0
        private void FrmPrintSetting_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (BtnExit.Enabled == true)
                {
                    BtnExit.PerformClick();
                    return;
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 9
0
 private void FrmDepartment_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendKeys.Send("{Tab}");
     }
     else if (e.KeyCode == Keys.Escape)
     {
         if (BtnCancel.Enabled == true)
         {
             _Tag = "";
             BtnCancel.PerformClick();
         }
         else
         {
             BtnExit.PerformClick();
         }
         DialogResult = DialogResult.Cancel;
         return;
     }
 }
Exemplo n.º 10
0
        private void Robot_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.N: { NorthBtn.PerformClick(); break; }

            case Keys.S: { SouthBtn.PerformClick(); break; }

            case Keys.W: { WestBtn.PerformClick(); break; }

            case Keys.E: { EastBtn.PerformClick(); break; }

            case Keys.NumPad1: { Go1Btn.PerformClick(); break; }

            case Keys.NumPad0: { Go10Btn.PerformClick(); break; }

            case Keys.Back: { BtnExit.PerformClick(); break; }

            case Keys.Escape: { BtnExit.PerformClick(); break; }
            }
        }
Exemplo n.º 11
0
        private void FrmProductScheme_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && this.ActiveControl != Grid)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (BtnCancel.Enabled == true)
                {
                    _Tag = "";
                    BtnCancel.PerformClick();
                }
                else if (BtnCancel.Enabled == false)
                {
                    BtnExit.PerformClick();
                }

                DialogResult = DialogResult.Cancel;
                return;
            }
        }
Exemplo n.º 12
0
 // Exit
 private void BtnKilepes_Click(object sender, EventArgs e)
 {
     BtnExit.Hide();
     PanelExit.Show();
 }