UpdateParent() public method

Gets and sets the root control for point translation and message dispatch.
public UpdateParent ( Control parent ) : void
parent System.Windows.Forms.Control Parent control.
return void
Example #1
0
        private void UpdateParent(Control parentControl)
        {
            // During disposal the view control will no longer exist
            if (_viewControl != null)
            {
                // If the view control is not inside the correct parent
                if (parentControl != _viewControl.Parent)
                {
                    // Ensure the control is not in the display area when first added
                    _viewControl.Location = new Point(-_viewControl.Width, -_viewControl.Height);

                    // Add our control to the provided parent collection
                    CommonHelper.AddControlToParent(parentControl, _viewControl);

                    // Let the actual control hook into correct parent for view manager processing
                    _viewControl.UpdateParent(parentControl);
                }
            }
        }