Added logic to eliminate mouse_up response on a tree after a node is expanded

Added Mouse_down event handler to reset ExpandingTree variable.
This commit is contained in:
Rich 2013-03-13 14:58:41 +00:00
parent 7eded680a7
commit 33fc77ca02
2 changed files with 13 additions and 0 deletions

View File

@ -713,6 +713,7 @@ namespace VEPROMS
this.tv.Size = new System.Drawing.Size(30, 474);
this.tv.TabIndex = 1;
this.tv.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tv_MouseUp);
this.tv.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tv_MouseDown);
this.tv.SectionShouldClose += new Volian.Controls.Library.vlnTreeViewSectionInfoEvent(this.tv_SectionShouldClose);
this.tv.WordSectionDeleted += new Volian.Controls.Library.WordSectionDeletedEvent(this.tv_WordSectionDeleted);
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);

View File

@ -879,8 +879,17 @@ namespace VEPROMS
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void tv_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
_ExpandingTree = false;
}
void tv_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (_ExpandingTree)
{
_ExpandingTree = false;
return;
}
if (e.Button != MouseButtons.Right)
{
Point newPoint = new Point(e.X, e.Y);
@ -925,8 +934,11 @@ namespace VEPROMS
tmrAutomatic.Enabled = false; // Timer has now fired
RunAutomatic();
}
private bool _ExpandingTree=false;
private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
_ExpandingTree = true;
Volian.Base.Library.vlnStackTrace.ShowStackLocal("tv_BeforeExpand", 3);
VETreeNode tn = ((VETreeNode)e.Node);
tn.LoadingChildrenDone += new VETreeNodeEvent(tn_LoadingChildrenDone);
tn.LoadingChildrenMax += new VETreeNodeEvent(tn_LoadingChildrenMax);