TouchToolKit for WinForms | ComponentOne
Zooming Component / C1Zoom Elements / C1Zoom Control Bar Element / Adding Control Bar Element
In This Topic
    Adding Control Bar Element
    In This Topic

    The following topic shows how to add the ControlBar to your project:

    1. Add a UserControl to the project. In the Solution Explorer, right-click the solution name and select Add| User Control. Name the user control (MyControlBar1)
    2. Click Add in the Add New Item dialog box.
    3. Add two Standard Buttons, Button1 and Button2 to MyControlBar1.
    4. Add the C1ZoomCommandProvider from the Toolbox. If it does not appear in the Toolbox, right-click the Toolbox and select Add Tab. Name the tab TouchToolKit and right-click the area in the tab and select Choose Items. Browse to the location of the C1.Win.C1TouchToolKit.x.dll and click Open. The C1ZoomCommandProvider1 item will appear in the component tray.
    5. Click the smart-tag anchor of Button1, then select ZoomIn from the list of C1ZoomCommands. Note: The C1.Win.C1TouchToolKit.x.Design should be referenced to your project for the smart-tag anchor to appear when you clikc on the control.

     

     adding controbar

    1. Repeat same step for Button2, and select ZoomOut from the list.
    2. Set Button1’s Text to Zoom In and Button2’s Text to Zoom Out.
    3. Build the project.
    4. In design-time, add a C1Zoom to the Form. (C1Zoom1).
    5. Select C1Zoom1 from the Properties Window and click on the ellipsis button next to the ControlBars property in the Properties Window.

    The ControlBar Collection Editor appears:

    control bar collection editor

    1. Click Add in the ControlBar Collection Editor window.
    2. Click on the dropdown arrow next to the Content property and select WindowsForms1.MyControlBar1.
    3. Click OK to save and close the ControlBar Collection Editor.
    4. Add a Standard control such as a Button to Form1.
    5. Run the project, and click on the Zoom In button to zoom in on the Button control and click on the Zoom Out button to zoom out on the button control.

    Notice the button1 control will appear larger each time you click on the Zoom In button and then gradually zoom out each time you click on the Zoom Out button.