src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeControl.cs
/// <summary>
///     Called when an item is double-clicked
/// </summary>
/// <param name="e">VirtualTreeControl specific DoubleClickEventArgs</param>
Called when an item is double-clicked
Called when an item is double - clicked
protected virtual void OnDoubleClick(DoubleClickEventArgs e)
        {
            var handler = Events[EVENT_DOUBLECLICK] as DoubleClickEventHandler;
            if (handler != null)
            {
                handler(this, e);
            }
            if (!e.Handled
                && myTree != null
                && e.Button == MouseButtons.Left)
            {
                var hitInfo = e.HitInfo;
                if (0 != (hitInfo.HitTarget & VirtualTreeHitTargets.OnItem))
                {
                    var itemInfo = e.ItemInfo;
                    if (0 != (hitInfo.HitTarget & VirtualTreeHitTargets.OnItemStateIcon))
                    {
                        ToggleAndSynchronizeState(hitInfo.Row, hitInfo.NativeColumn);
                    }
                    else if (itemInfo.Expandable)
                    {
                        myTree.ToggleExpansion(hitInfo.Row, hitInfo.NativeColumn);
                    }
                    else if (myStateImageList != null)
                    {
                        myTree.ToggleState(hitInfo.Row, hitInfo.NativeColumn);
                    }
                }
                else if (0 != (hitInfo.HitTarget & VirtualTreeHitTargets.OnItemButton))
                {
                    SetStateFlag(VTCStateFlags.CallDefWndProc, false);
                }
            }
        }
protected virtual void OnDoubleClick ( DoubleClickEventArgs e ) { var handler = Events [ EVENT_DOUBLECLICK ] as DoubleClickEventHandler ; if ( handler != null ) { handler ( this , e ) ; } if ( ! e . Handled && myTree != null && e . Button == MouseButtons . Left ) { var hitInfo = e . HitInfo ; if ( 0 != ( hitInfo . HitTarget & VirtualTreeHitTargets . OnItem ) ) { var itemInfo = e . ItemInfo ; if ( 0 != ( hitInfo . HitTarget & VirtualTreeHitTargets . OnItemStateIcon ) ) { ToggleAndSynchronizeState ( hitInfo . Row , hitInfo . NativeColumn ) ; } else if ( itemInfo . Expandable ) { myTree . ToggleExpansion ( hitInfo . Row , hitInfo . NativeColumn ) ; } else if ( myStateImageList != null ) { myTree . ToggleState ( hitInfo . Row , hitInfo . NativeColumn ) ; } } else if ( 0 != ( hitInfo . HitTarget & VirtualTreeHitTargets . OnItemButton ) ) { SetStateFlag ( VTCStateFlags . CallDefWndProc , false ) ; } } }
Called when an item is double-clicked
Called when an item is double - clicked
// Treat a double click as two single clicks if applied directly to // the state icon. // Just toggle here, don't synchronize. This behavior is consisten // with the standard ListView control. The synchronization is hard // for the user and code to coordinate because the single click just // toggled the selection state. // avoid calling the DefWndProc if the click was on the button, because this // causes scrolling to the selected index, which may not be the one double-clicked on.
e
DoubleClickEventArgs
VirtualTreeControl specific DoubleClickEventArgs
VirtualTreeControl specific DoubleClickEventArgs