/// <summary> /// Sets the size of the automatic. /// </summary> /// <param name="control">The control.</param> /// <param name="value">if set to <c>true</c> [value].</param> public static void SetAutoSize(this ToolStrip control, bool value) { if (control.InvokeRequired) { control.BeginInvoke(new MethodInvoker(() => control.SetAutoSize(value))); } else { control.AutoSize = value; control.Refresh(); } }