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