public ToolStripControlHost(Control c) { _control = c ?? throw new ArgumentNullException(nameof(c), SR.ControlCannotBeNull); SyncControlParent(); c.Visible = true; SetBounds(c.Bounds); // now that we have a control set in, update the bounds. Rectangle bounds = Bounds; CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.Width, bounds.Height); c.ToolStripControlHost = this; OnSubscribeControlEvents(c); }
public ToolStripControlHost(Control c) { _control = c.OrThrowIfNullWithMessage(SR.ControlCannotBeNull); SyncControlParent(); c.Visible = true; SetBounds(c.Bounds); // now that we have a control set in, update the bounds. Rectangle bounds = Bounds; CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.Width, bounds.Height); c.ToolStripControlHost = this; OnSubscribeControlEvents(c); }
public ToolStripControlHost(System.Windows.Forms.Control c) { this.controlAlign = ContentAlignment.MiddleCenter; if (c == null) { throw new ArgumentNullException("c", "ControlCannotBeNull"); } this.control = c; this.SyncControlParent(); c.Visible = true; this.SetBounds(c.Bounds); Rectangle bounds = this.Bounds; CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.Width, bounds.Height); this.OnSubscribeControlEvents(c); }
/// <include file='doc\ToolStripControlHost.uex' path='docs/doc[@for="ToolStripControlHost.ToolStripControlHost"]/*' /> /// <devdoc> /// Constructs a ToolStripControlHost /// </devdoc> public ToolStripControlHost(Control c) { if (c == null) { throw new ArgumentNullException(nameof(c), SR.ControlCannotBeNull); } control = c; SyncControlParent(); c.Visible = true; SetBounds(c.Bounds); // now that we have a control set in, update the bounds. Rectangle bounds = this.Bounds; CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.Width, bounds.Height); if (!AccessibilityImprovements.UseLegacyToolTipDisplay) { c.ToolStripControlHost = this; } OnSubscribeControlEvents(c); }