ComponentOne Windows 7 Control Pack for WinForms
Windows 7 Control Pack for WinForms Task-Based Help / C1TaskDialog Task-Based Help / Adding Command Link Buttons
In This Topic
    Adding Command Link Buttons
    In This Topic

    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 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 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 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:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    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
    

    To write code in C#

    C#
    Copy Code
    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);
    }
    

    When You've Accomplished

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