From 6618b1f51e996368f0a55a5582d0e22846f1e243 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 17 Dec 2010 23:54:52 +0000 Subject: [PATCH] When a StepTabPanel is Disposed, if it is associated with the SelectedDisplayTabItem, set the SelectedDisplayTabItem to null. This was causing an error where a deleted Procedure was the last SelectedDisplayTabItem. When anything was opened, the code tried to find the MyProcedure of the last SelectedDisplayTabItem. Since the last one had been deleted, it had no MyProcedure. --- PROMS/Volian.Controls.Library/StepTabPanel.designer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs b/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs index 64545d37..682995a0 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.designer.cs @@ -13,6 +13,10 @@ namespace Volian.Controls.Library /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { + // when a StepTabPanel is Disposed, if it was associated with the SelectedDisplayTabItem, set the SelectedDisplayTabItem to null + // this was causing an error where a deleted Procedure was being referenced, since it was the last SelectedDisplayTabItem + if (MyDisplayTabControl.SelectedDisplayTabItem != null && MyDisplayTabControl.SelectedDisplayTabItem.MyStepTabPanel == this) + MyDisplayTabControl.SelectedDisplayTabItem = null; if (disposing && (components != null)) { components.Dispose();