# Adding Command Link Buttons

## Content



Command links have a clean, lightweight appearance that allows for descriptive labels, and are displayed with either a standard arrow or custom icon, and an optional supplemental explanation. For more information, see the [Command Links](/componentone/docs/win/online-winpack/workingwithwindows7c/workingwithc1taskdia/commandlinks) topic. In this topic, you'll add a command link button to an existing **C1TaskDialog** control.

### In the Tasks Menu

Complete the following steps to add a command link button with an access key to an existing **C1TaskDialog** control:

1.  On the Form in Design view, click once on the **C1TaskDialog** component to select it.
2.  Click the control's smart tag to open the **C1TaskDialog Tasks** menu. For more information about the menu, see the [C1TaskDialog Tasks Menu](/componentone/docs/win/online-winpack/designtimesupport/windows7controlpackf3/c1taskdialogtasksmen) topic.
3.  In the **C1TaskDialog Tasks** menu, confirm that the **Use Command Links** check box is checked.
4.  In the **C1TaskDialog Tasks** menu, click the **Add Custom Buttons** item. The **C1TaskDialog.CustomButtons Collection Editor** will open.
5.  In the **CustomButtons Collection Editor**, click the **Add** button to add a new **CustomButton**.
6.  Edit the button's **Note** text in the Properties pane, for example set it to "This button is a custom command link."
7.  Set the button's **Text** property in the Properties pane to "Command Link Example".
8.  Click OK to close the **CustomButtons Collection Editor**.

### In the Properties Window

Complete the following steps to add a command link button with an access key to an existing **C1TaskDialog** control:

1.  On the Form in Design view, click once on the **C1TaskDialog** component to select it.
2.  Navigate to the Properties window and confirm that the [UseCommandLinks](/componentone/api/win/online-winpack/dotnet-framework-api/C1.Win.C1Win7Pack.4.8/C1.Win.C1Win7Pack.C1TaskDialog.UseCommandLinks.html) property is set to **True**.
3.  In the Properties window, click the ellipses button next to the **CustomButtons** item. Alternatively, if the **Commands** area beneath the Properties window is displayed, you can select the **Edit Custom Buttons** item. The **C1TaskDialog.CustomButtons Collection Editor** will open.
4.  In the **CustomButtons Collection Editor**, click the **Add** button to add a new **CustomButton**.
5.  Edit the button's **Note** text in the Properties pane, for example set it to "This button is a custom command link."
6.  Set the button's **Text** property in the Properties pane to "Command Link Example".
7.  Click OK to close the **CustomButtons Collection Editor**.

### In Code

The following code adds a command link button to an existing **C1TaskDialog** control:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim C1CustomButton1 As New C1.Win.C1Win7Pack.C1CustomButton
    C1CustomButton1.Text = "Command Link Example"
    C1CustomButton1.Note = "This button is a custom command link."
    C1TaskDialog1.CustomButtons.Add(C1CustomButton1)
End Sub
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
public Form1()
{
    InitializeComponent();
    C1CustomButton c1CustomButton1 = new C1CustomButton();
    c1CustomButton1.Text = "Command Link Example";
    c1CustomButton1.Note = "This button is a custom command link.";
    c1TaskDialog1.CustomButtons.Add(c1CustomButton1);
}
```

DOC-DETAILS-TAG-CLOSE

### When You've Accomplished

In this topic, you've added a command link button to an existing **C1TaskDialog** control.