packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/Direct2D/D2DShapes/D2DShapesControl.cs
/// <summary>
/// Stop rendering if removed from a parent control
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
Stop rendering if removed from a parent control
Stop rendering if removed from a parent control
protected override void OnParentChanged(EventArgs e)
        {
            lock (renderSyncObject)
            {
                if (Parent == null)
                    render = null;
            }
            base.OnParentChanged(e);
        }
protected override void OnParentChanged ( EventArgs e ) { lock ( renderSyncObject ) { if ( Parent == null ) render = null ; } base . OnParentChanged ( e ) ; }
Stop rendering if removed from a parent control
Stop rendering if removed from a parent control
e
EventArgs
An  that contains the event data.
An that contains the event data .