Solange wie ich ein Editfenster habe ist alles Ok. Da komme ich ja an den Text des Scanners ran.
Ohne Editfenster bekomme ich bei meinen Grundformular das KeyEreignis #13 noch mit aber wo finde ich dann den Text vom Scanner??? Wo wird der gebunkert?
'Gebunkert' wird ohne Edit gar nicht..
Das müsstest Du schon selber machen.
Beispiel:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 =
class(TForm)
procedure FormKeyPress(Sender: TObject;
var Key: Char);
private
FBarcodeVal :
string;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13
then begin
// Verarbeite den Barcode
// Alten Barcode löschen
FBarcodeVal := '
';
end else begin
FBarcodeVal := FBarcodeVal + Key;
end;
end;
end.
Denke aber an 'KeyPreview' auf true setzen..