Exemple #1
0
 /// <summary>
 /// Sets the text image relation.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetTextImageRelation(this ButtonBase control, TextImageRelation value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetTextImageRelation(value)));
     }
     else
     {
         control.TextImageRelation = value;
         control.Refresh();
     }
 }
Exemple #2
0
 /// <summary>
 /// Sets the use compatible text rendering.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">if set to <c>true</c> [value].</param>
 public static void SetUseCompatibleTextRendering(this ButtonBase control, bool value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetUseCompatibleTextRendering(value)));
     }
     else
     {
         control.UseCompatibleTextRendering = value;
         control.Refresh();
     }
 }
Exemple #3
0
 /// <summary>
 /// Sets the text.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetText(this ButtonBase control, string value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetText(value)));
     }
     else
     {
         control.Text = value;
         control.Refresh();
     }
 }
Exemple #4
0
 /// <summary>
 /// Sets the text align.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetTextAlign(this ButtonBase control, ContentAlignment value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetTextAlign(value)));
     }
     else
     {
         control.TextAlign = value;
         control.Refresh();
     }
 }
Exemple #5
0
 /// <summary>
 /// Sets the automatic ellipsis.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">if set to <c>true</c> [value].</param>
 public static void SetAutoEllipsis(this ButtonBase control, bool value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetAutoEllipsis(value)));
     }
     else
     {
         control.AutoEllipsis = value;
         control.Refresh();
     }
 }
Exemple #6
0
 /// <summary>
 /// Sets the color of the back.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetBackColor(this ButtonBase control, Color value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetBackColor(value)));
     }
     else
     {
         control.BackColor = value;
         control.Refresh();
     }
 }
Exemple #7
0
 /// <summary>
 /// Sets the image list.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetImageList(this ButtonBase control, ImageList value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetImageList(value)));
     }
     else
     {
         control.ImageList = value;
         control.Refresh();
     }
 }
Exemple #8
0
 /// <summary>
 /// Sets the flat style.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetFlatStyle(this ButtonBase control, FlatStyle value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetFlatStyle(value)));
     }
     else
     {
         control.FlatStyle = value;
         control.Refresh();
     }
 }
Exemple #9
0
 /// <summary>
 /// Sets the use mnemonic.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">if set to <c>true</c> [value].</param>
 public static void SetUseMnemonic(this ButtonBase control, bool value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetUseMnemonic(value)));
     }
     else
     {
         control.UseMnemonic = value;
         control.Refresh();
     }
 }