コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }