Ejemplo n.º 1
0
 private void EditKeyCode(UpgradeHelpers.Windows.Forms.DataGridViewFlex grid, ref TextBox txtBox, int KeyCode, int Shift)
 {
     switch(KeyCode)
     {
         case 27 :  //ESC
             txtBox.Text = "";
             txtBox.Visible = false;
             grid.Focus();
             break;
         case 13 :  //Return
             grid.Focus();
             break;
         case 37 :  //Left Arrow
             grid.Focus();
             Application.DoEvents();
             if (grid.CurrentColumnIndex > grid.FixedColumns)
             {
                 grid.CurrentColumnIndex--;
             }
             break;
         case 38 :  //Up Arrow
             grid.Focus();
             Application.DoEvents();
             if (grid.CurrentRowIndex > grid.FixedRows)
             {
                 grid.CurrentRowIndex--;
             }
             break;
         case 39 :  //Right Arrow
             grid.Focus();
             Application.DoEvents();
             if (grid.CurrentColumnIndex < grid.ColumnsCount - 1)
             {
                 grid.CurrentColumnIndex++;
             }
             break;
         case 40 :  //Down Arrow
             grid.Focus();
             Application.DoEvents();
             if (grid.CurrentRowIndex < grid.RowsCount - 1)
             {
                 grid.CurrentRowIndex++;
             }
             break;
     }
 }
Ejemplo n.º 2
0
 private void MakeTextBoxVisible(TextBox txtBox, UpgradeHelpers.Windows.Forms.DataGridViewFlex grid)
 {
     txtBox.Text = Convert.ToString(grid[grid.CurrentRowIndex, grid.CurrentColumnIndex].Value);
     txtBox.SetBounds(Convert.ToInt32((float) (grid.CellLeft / 15 + grid.Left)), Convert.ToInt32((float) (grid.CellTop / 15 + grid.Top)), Convert.ToInt32((float) (grid.CellWidth / 15)), Convert.ToInt32((float) (grid.CellHeight / 15)));
     txtBox.Visible = true;
     Application.DoEvents();
     txtBox.Focus();
     modFunctions.SelectAll(txtBox);
 }
Ejemplo n.º 3
0
 private void MakeTextBoxVisible(TextBox txtBox, UpgradeHelpers.Windows.Forms.DataGridViewFlex grid)
 {
     //  If .Row < 0 Or .col < 0 Then Exit Sub
     //  txtBox.Text = .TextMatrix(.Row, .col)
     //  txtBox.Move .CellLeft + .Left, .CellTop + .Top, .CellWidth, .CellHeight
     //   txtBox.Visible = True
     //  DoEvents
     editingQuantity = true;
     txtBox.Focus();
 }