WinUI | ComponentOne
Controls / BarCode / Caption Customization
In This Topic
    Caption Customization
    In This Topic

    The BarCode control provides the following properties to customize the caption:

    CaptionPosition

    The CaptionPosition property of the C1BarCode class lets you specify caption's position relative to the barcode symbol. The CaptionPosition property calls BarCodeCaptionPosition enumeration which provides following values to specify the position of caption:

    Values Description
    None It hides the caption from displaying either above or below the barcode image.
    Above It shows the caption above the barcode image.
    Below It shows the caption below the barcode image.

    The following image shows position of caption after setting the value of CaptionPosition property to Above :

    Barcode position

    The code snippet below is used to set the position of caption on the top of the barcode symbol:

    <BarCode:C1BarCode x:Name="barCode" CaptionPosition="Above"> </BarCode:C1BarCode>
    
    barCode.CaptionPosition=BarCodeCaptionPosition.Above;
    

    CaptionGrouping

    The CaptionGrouping property of the C1BarCode class lets you specify a boolean value indicating whether to add spaces between groups of characters in the caption to make long numbers easier to read. The value of CaptionGrouping property can be set to either True or False. When the value of the CaptionGrouping property is True, the following image with grouping in caption appears:

    Barcode Caption Grouping

    Now, when you set the value of the CaptionGrouping property to False, the caption under the barcode symbol gets ungrouped, as shown in the following image:

    Barcode Caption Grouping

    The code snippet below is used to set the grouping of caption under the barcode symbol:

    <BarCode:C1BarCode x:Name="barCode" CaptionPosition="Below" CaptionGrouping="False"> </BarCode:C1BarCode>
    
    barCode.CaptionGrouping=false;