Handle the global keyboard input on your form like this :
private string _barcode = "";
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
char c = (char)keyData;
if (char.IsNumber(c))
_barcode += c;
if (c == (char)Keys.Return)
{
DoSomethingWithBarcode(_barcode);
_barcode="";
}
return base.ProcessCmdKey(ref msg, keyData);
}
and do what you need with the barcode value in
DoSomethingWithBarcode()
method.