Thema: Delphi Wie Sender ermitteln ?

Einzelnen Beitrag anzeigen

Benutzerbild von Armageddon
Armageddon

Registriert seit: 30. Mär 2003
Ort: Wilflingen
158 Beiträge
 
#9

Re: Wie Sender ermitteln ?

  Alt 22. Aug 2003, 18:09
Hmmm hab nun nochmal ein Prob das genau mit dem zusammenhängt!

Kann ich das mit dem Component as bla bla bla auch mit dem Code machen:

Delphi-Quellcode:
procedure TForm1.Z_PositionKeyPress(Sender: TObject; var Key: Char);
var
  Position: Integer;
  Stellenpuffer: String;
  Zeichenpuffer: String;
  Stellenanzahl: Integer;
begin
  Komma := False;
  Zeichenpuffer := Z_Position.Text;
  if Pos(',', Zeichenpuffer) > 0 then Komma := True;
  if (Komma = True) and (Key = #44) then Key := #0;
  if (Komma = True) and (Key = #46) then Key := #0;
  if (Komma = False) and (Key = #46) then Key := ',';
  if Z_Position.SelStart < Pos(',', Z_Position.Text) then
  else
  if Pos(',', Zeichenpuffer) > 0 then
    begin
    Stellenanzahl := Length(Zeichenpuffer);
    Position := Pos(',', Zeichenpuffer);
    Stellenpuffer := Copy(Zeichenpuffer, Position+1, Stellenanzahl-Position);
    Stellenanzahl := Length(Stellenpuffer);
    if Stellenanzahl = 3 then
    begin
      if (Key in [#44, #46, #48..#57]) then Key := #0
    end;
  end;
  if Z_Position.SelStart < Pos('-', Z_Position.Text) then
    begin
    if (Key in [#48..#57]) then Key := #0;
    end;
  if Key = #13 then Key := #0;
  if not (Key in [#8, #44..#46, #48..#57]) then Key := #0;
  if Z_Position.SelStart = 0 then
    begin
    if Key = #45 then Key := #45;
    end;
  if Z_Position.SelStart > 0 then
    begin
    if Key = #45 then Key := #0
    end;
  if Pos('-', Z_Position.Text) > 0 then
    begin
    if Key = #45 then Key := #0
    end;
end;
Hab von demselben 8 Stück in meinem Programm aber ändern würde sich immer nur das Z_Position.*** weil das ja je nach aktivem Editfeld wo ich reinschreibe nen andern Namen hat.

Wär für jede Hilfe dankbar.


Gruß Arma.
  Mit Zitat antworten Zitat