From b78e720313770858b5d32c93b78ee3d8c59aad3c Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 9 Mar 2011 11:54:40 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/StepRTB.cs | 37 ++++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 276b80c3..f5330561 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1856,11 +1856,37 @@ namespace Volian.Controls.Library SendKeys.Send("%H{ESC}"); break; case Keys.Tab: - e.SuppressKeyPress = true; - e.Handled = true; - Form frm = ParentForm(this); - if (frm != null) - frm.SelectNextControl(this, true, true, true, true); + VlnFlexGrid myGrid = Parent as VlnFlexGrid; + if (myGrid == null) + { + e.SuppressKeyPress = true; + e.Handled = true; + Form frm = ParentForm(this); + if (frm != null) + frm.SelectNextControl(this, true, true, true, true); + } + else + { + if (e.Shift) + { + e.SuppressKeyPress = true; + e.Handled = true; + if (!myGrid.SelectPrevCell()) + { + // don't do anything if at top (for now) + } + } + else + { + e.SuppressKeyPress = true; + e.Handled = true; + if (!myGrid.SelectNextCell()) + { + myGrid.Rows.Add(1); + myGrid.SelectNextCell(); + } + } + } break; case Keys.Enter: if (!e.Control && !e.Shift && !e.Alt) @@ -2859,7 +2885,6 @@ namespace Volian.Controls.Library private bool _LastWasLeftArrow = false; private void StepRTB_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { - //Console.WriteLine("StepRTB_PreviewKeyDown"); if ((e.KeyCode == Keys.Tab) && (!e.Alt && !e.Control)) e.IsInputKey = true; // Remember if the last key pressed was a left arrow. This is used in HandleSelectionChanged