0

I parse a string which contains in its innards a barcode value (such as 02410103775).

I create a label dynamically for it like so:

private void PrintBarcodeGettingInTouchWithItsInnerZebra(string lineToParse)
{
    string barcodeText = GetBarcodeVal(lineToParse);
    int barcodeHeight = Convert.ToInt32(GetBarcodeHeight(lineToParse));
    int barcodeVertStartPos = GetBarcodeNextVerticalStartingPoint(lineToParse);

    Label lblBarcode = new Label();
    lblBarcode.Text = barcodeText;
    lblBarcode.Font = new Font(lblBarcode.Font.Name, barcodeHeight, lblBarcode.Font.Style);
    lblBarcode.Top = barcodeVertStartPos;
    lblBarcode.Left = GetBarcodeNextHorizontalStartingPoint(lineToParse); 
    //lblBarcode.Parent = panel2by1LabelProxy; // <-- Is this preferred, or the line below?
    panel2by1LabelProxy.Controls.Add(lblBarcode);
}

Right now it simply shows the barcode value "raw" (as "02410103775" or so); is there a way to morph the lable text into a barcode representation? I'm hoping it's as trivial as knowing the right font.Name to use...

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

0 Answers0