From 44bc2844eb6b33f265e648514b8e69a06fef5637 Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 10 Apr 2014 20:30:14 +0000 Subject: [PATCH] Rmove Debug Comments Changed code to remove temporary panel. --- PROMS/Volian.Controls.Library/EditItem.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 57b22fa3..95548471 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -670,14 +670,13 @@ namespace Volian.Controls.Library //ShowTops("\r\n"); int TopMostYBefore = TopMostEditItem.Top; //_MyTimer.ActiveProcess = "DeleteItem"; - Panel pnl = new Panel(); - pnl.Size = new Size(10, 10); - MyStepPanel.Controls.Add(pnl); - pnl.BackColor = Color.Red; - pnl.Location = new Point(xOffset += 15, MyStepPanel.ClientSize.Height + 10); - //Console.WriteLine("'Before Debete Item',{0},'{1}','{2}',{3},,,{4},{5}", MyID, MyItemInfo.ShortPath, MyItemInfo.DisplayText, Top, MyStepPanel.VerticalScroll.Value, MyStepPanel.DisplayRectangle.Height); - EditItem newFocus = DeleteItem(); - //Console.WriteLine("'After Debete Item',{0},'{1}','{2}',{3},,,{4},{5}", MyID, MyItemInfo.ShortPath, Top, MyItemInfo.DisplayText, MyStepPanel.VerticalScroll.Value, MyStepPanel.DisplayRectangle.Height); + // Add a Panel temporarily so that AutoScroll will not happen during the delete. + Panel pnl = new Panel(); + pnl.Size = new Size(10, 10); + MyStepPanel.Controls.Add(pnl); + pnl.BackColor = Color.Red; + pnl.Location = new Point(xOffset += 15, MyStepPanel.ClientSize.Height+10); + EditItem newFocus = DeleteItem(); if (newFocus == null) { MyStepPanel.Controls.Remove(pnl); @@ -698,8 +697,7 @@ namespace Volian.Controls.Library //newFocus.ShowTops(""); //_MyTimer.ShowElapsedTimes("RemoveItem"); ForceEditItemRefresh(newFocus); - //MyStepPanel.Controls.Remove(pnl); - MyStepPanel.AutoScroll = true; + MyStepPanel.Controls.Remove(pnl); } private static void ForceEditItemRefresh(EditItem newFocus)