6 Şubat 2016 Cumartesi

FireMonkey ile InputQuery Kullanımı

Aşağıdaki örnek kod ile AdSoyad değişkenine inputquery ile açılan dialog penceresinden değer atanacak ve bu işlem her platformda çalışır halde (Android ve Windows üzerinde test edildi). Neden bunu yazıyorum eski bilinen yöntemlerle inputquery ile kod ne yazık ki Android platformunda hata vermekte.



Form ile ilgili class'ın private kısmında olması gereken

type
  TFrTeklif = class(TFrame)
.....
private
    { Private declarations }
    AdSoyad: String;
    procedure OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);

public
.......


// Buttona ait click olayı
procedure TFrTeklif.bYeniTeklifClick(Sender: TObject);
var
  Values: array[0 .. 0] of string;
begin
  Values[0] := String.Empty;
  InputQuery('Yeni Teklif', ['Ad ve Soyad bilgisini giriniz'], Values, Self.OnInputQuery_Close);
end;

procedure TFrTeklif.OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);
begin
  if AResult <> mrOk then Exit;
  AdSoyad := AValues[0];
end;


Hiç yorum yok:

Yorum Gönder