B2012-350 added call to save the text before it processes a tab change

B2012-347 fixed problem with doing a find text after doing a spell check
B2012-350 needed to add a count check for the list of tab items
This commit is contained in:
2012-12-06 03:32:50 +00:00
parent 5302c8a95f
commit 4d0346f0f8
3 changed files with 16 additions and 4 deletions

View File

@@ -594,6 +594,7 @@ namespace Volian.Controls.Library
this.SelectionChanged -= new EventHandler(StepRTB_SelectionChanged);
this.ContextMenuStripChanged -= new EventHandler(StepRTB_ContextMenuStripChanged);
this.RTBSelectionChanged -= new StepRTBEvent(StepRTB_RTBSelectionChanged);
this.HandleCreated -= new EventHandler(StepRTB_HandleCreated);
this.HandleDestroyed -= new EventHandler(StepRTB_HandleDestroyed);
_EventHandlersForKeyPress = _EventHandlersForKeyPress - 1;
}
@@ -619,9 +620,15 @@ namespace Volian.Controls.Library
this.SelectionChanged +=new EventHandler(StepRTB_SelectionChanged);
this.ContextMenuStripChanged += new EventHandler(StepRTB_ContextMenuStripChanged);
this.RTBSelectionChanged += new StepRTBEvent(StepRTB_RTBSelectionChanged);
this.HandleCreated += new EventHandler(StepRTB_HandleCreated);
this.HandleDestroyed += new EventHandler(StepRTB_HandleDestroyed);
_EventHandlersForKeyPress = _EventHandlersForKeyPress+1;
}
private int _HandleCount = 0;
void StepRTB_HandleCreated(object sender, EventArgs e)
{
_HandleCount++;
}
// When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed
// event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the
// keypress event handler was not run. The following was added so that the keypress event is restored
@@ -640,8 +647,12 @@ namespace Volian.Controls.Library
}
void StepRTB_HandleDestroyed(object sender, EventArgs e)
{
Closed = true;
RemoveEventHandlers();
if (_HandleCount == 0)
{
Closed = true;
RemoveEventHandlers();
}
_HandleCount--;
}
void StepRTB_RTBSelectionChanged(object sender, EventArgs args)
{