<commit_before>---
title: Overview
page_title: Button | UI for WinForms Documentation
description: Button
slug: winforms/buttons/button
tags: button
published: True
position: 0
---

# Button

![buttons-button-overview 001](images/buttons-button-overview001.png)

__RadButton__ is a replacement of the standard WinForms Button. __RadButton__ supports themes.
        

* To add a __RadButton__ to your form, drag a __RadButton__ from the toolbox onto the surface of the form designer.

* To programmatically add a RadButton to a form, create a new instance of a __RadButton__, and add it to the form __Controls__ collection.

__[C#] Adding a RadButton at runtime__

{{source=..\SamplesCS\Buttons\Button.cs region=creatingbutton}} 
{{source=..\SamplesVB\Buttons\Button.vb region=creatingbutton}} 

````C#
RadButton myNewRadButton = new RadButton();
myNewRadButton.Text = "My New RadButton";
myNewRadButton.Width = 150;
myNewRadButton.Height = 50;
this.Controls.Add(myNewRadButton);

````
````VB.NET
Dim myNewRadButton As New RadButton()
myNewRadButton.Text = "My New RadButton"
myNewRadButton.Width = 150
myNewRadButton.Height = 50
Me.Controls.Add(myNewRadButton)

````

{{endregion}} 




## Antialiased text

Use the following code snippet to set the __TextRenderingHint__ property of the __TextPrimitive__ to use antialiasing: 

{{source=..\SamplesCS\Buttons\Button.cs region=textrenderinghint}} 
{{source=..\SamplesVB\Buttons\Button.vb region=textrenderinghint}} 

````C#
((TextPrimitive)myNewRadButton.ButtonElement.Children[1].Children[1]).TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

````
````VB.NET
DirectCast(myNewRadButton.ButtonElement.Children(1).Children(1), TextPrimitive).TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias

````

{{endregion}} 


You can alternatively create a theme using the Visual Style Builder which sets the property for the TextPrimitive node.
        
<commit_msg>Testing redirects.<commit_after>---
title: Overview
page_title: Button | UI for WinForms Documentation
description: Button
slug: winforms/buttons/button
tags: button
published: True
position: 0
previous_url: /help/winforms/buttons-button-overview.html
---

# Button

![buttons-button-overview 001](images/buttons-button-overview001.png)

__RadButton__ is a replacement of the standard WinForms Button. __RadButton__ supports themes.
        

* To add a __RadButton__ to your form, drag a __RadButton__ from the toolbox onto the surface of the form designer.

* To programmatically add a RadButton to a form, create a new instance of a __RadButton__, and add it to the form __Controls__ collection.

__[C#] Adding a RadButton at runtime__

{{source=..\SamplesCS\Buttons\Button.cs region=creatingbutton}} 
{{source=..\SamplesVB\Buttons\Button.vb region=creatingbutton}} 

````C#
RadButton myNewRadButton = new RadButton();
myNewRadButton.Text = "My New RadButton";
myNewRadButton.Width = 150;
myNewRadButton.Height = 50;
this.Controls.Add(myNewRadButton);

````
````VB.NET
Dim myNewRadButton As New RadButton()
myNewRadButton.Text = "My New RadButton"
myNewRadButton.Width = 150
myNewRadButton.Height = 50
Me.Controls.Add(myNewRadButton)

````

{{endregion}} 




## Antialiased text

Use the following code snippet to set the __TextRenderingHint__ property of the __TextPrimitive__ to use antialiasing: 

{{source=..\SamplesCS\Buttons\Button.cs region=textrenderinghint}} 
{{source=..\SamplesVB\Buttons\Button.vb region=textrenderinghint}} 

````C#
((TextPrimitive)myNewRadButton.ButtonElement.Children[1].Children[1]).TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

````
````VB.NET
DirectCast(myNewRadButton.ButtonElement.Children(1).Children(1), TextPrimitive).TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias

````

{{endregion}} 


You can alternatively create a theme using the Visual Style Builder which sets the property for the TextPrimitive node.
        

{'fraction_non_alphanumeric': 0.10324483775811209, 'fraction_numerical': 0.01032448377581121, 'mean_word_length': 4.425333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2848968', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1232, 'n_words': 335}