Thema: Delphi Auslöser

Einzelnen Beitrag anzeigen

Benutzerbild von dataspider
dataspider

Registriert seit: 9. Nov 2003
Ort: 04539 Groitzsch
1.350 Beiträge
 
Delphi 11 Alexandria
 
#7

Re: Auslöser

  Alt 12. Dez 2005, 14:10
Wie mache ich das...
Statt einer Integer Variablen MyInteger die Variante mit Property:
Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    FMyInteger: Integer;
    procedure SetMyInteger(const Value: Integer);
    { Private-Deklarationen }
  public
    property MyInteger: Integer read FMyInteger write SetMyInteger;
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SetMyInteger(const Value: Integer);
begin
  if (FMyInteger <> Value) then
  begin
    // oder vorher procedure
    // if CheckValueOK(Value) then
    // FMeineInteger := Value
    if Value <= 10000 then
      FMyInteger := Value
    else
      ShowMessage('Nur bis 10000 gestattet...');
  end;
end;

end.
Gruß, Frank
Frank Reim
  Mit Zitat antworten Zitat