From 89cf82efa7a89dc106a3e8face02b731c4219c4f Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 22 May 2008 19:17:18 +0000 Subject: [PATCH] Adjust scroll location when DisplayTabControl is resized --- PROMS/Volian.Controls.Library/DisplayTabControl.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) {