ComponentOne BarCode for ASP.NET Web Forms
Quick Start / Step 2 of 3: Adding C1Barcode Controls
In This Topic
    Step 2 of 3: Adding C1Barcode Controls
    In This Topic

    In the last step you set up the application. In this step, you will continue by adding C1Barcode controls to the project and setting some of the properties to see what can be done with the controls.

    Complete the following steps:   

    1. If you are not already in Source View, switch to it now.
    2. Add the following markup within the <div> </div> tags  to format the application. Note that you're creating different sections to demonstrate C1Barcode properties, including a table. The commented sections are where the C1Barcode controls will be added:
    Markup
    Copy Code
     <div >
            <h2>BarCode Styles</h2>        
            <h4>The Value in these BarCodes is "1234567890" : </h4>
            //Add C1Barcode control here           
            <br />           
                <h4>Set the direction :</h4>
                <asp:Table ID="Table1" runat="server" Height="171px" Width="387px">
                    <asp:TableRow>
                        <asp:TableCell>Up</asp:TableCell>
                        <asp:TableCell>Down</asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            //Add C1Barcode control here
                        </asp:TableCell>
                        <asp:TableCell>
                            //Add C1Barcode control here
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>      
            <br />
            <div>
                <h4>Set BackColor and ForeColor</h4>
                <p>The BackColor is set to Yellow and the ForeColor is set to Blue</p>           
                //Add C1Barcode control here
            </div>
            <br />
            <div>
                <h4>Set Font for Text</h4>
                <p>TextFont: "Consolas, 8.25pt, style=Italic"</p>
                //Add C1Barcode control here
            </div>
            <br />
            <br />
        </div>
    
    1. Locate the markup that reads <h4>The value in these barcodes is "123456789" : </h4> and place your cursor below it. Locate the C1Barcode control in the Visual Studio Toolbox and double-click to add the control to your application. Using the Properties window, edit the control as follows:
      • Set the Text property to 1234567890
      • Set the ShowText property to True
    2. Add another C1Barcode control below the "Up" section. Using the Properties window again, edit the control as follows:        
    3. Add a fourth C1Barcode control below the "Down" section. Set the following properties:
    4. Add the fifth C1Barcode control in the "Set ForeColor and BackColor" below the <p>ForeColor: Blue</p> markup. Set the following properties:
    5. Add a final C1Barcode control below the <p>TextFont: "Consolas, 8.25pt, style=Italic"</p> markup. Set the following properties:
      • Set the Text property to 1234567890
      • Set the ShowText property to True
      • Set the TextFont property to Consolas, 8.25pt, style=Italic

    You have completed the step two of the C1Barcode Quick Start. In the next step, you'll run your application.

      See Also