diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index a3f15366..78492a5e 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -31,6 +31,8 @@ namespace Volian.Controls.Library /// A bar is the docking location for the DisplayTabItems. /// private int _UniqueBarCount; + private ItemInfo _MyItemInfo = null; + private StepItem _MyStepItem = null; #endregion #region Events /// @@ -130,6 +132,8 @@ namespace Volian.Controls.Library /// internal void OnItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) { + _MyItemInfo = args.MyItemInfo; + _MyStepItem = args.MyStepItem; if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args); } #endregion @@ -147,6 +151,13 @@ namespace Volian.Controls.Library _MyDisplayTabItems = new Dictionary(); SetupBar(_MyBar); dotNetBarManager1.BarTearOff += new EventHandler(dotNetBarManager1_BarTearOff); + this.Resize += new EventHandler(DisplayTabControl_Resize); + } + void DisplayTabControl_Resize(object sender, EventArgs e) + { + // If the currently selected Item is in a Step, then adjust the scroll as necessary to keep it visible + if (_MyStepItem != null) + _MyStepItem.ItemShow(); } private void SetupBar(Bar myBar) {