unit Unit1;interfaceuses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Edit, Data.Bind.EngExt, FMX.Bind.DBEngExt, Data.Bind.Components;type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; BindingsList1: TBindingsList; procedure FormCreate(Sender: TObject); procedure Edit1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure Edit1Change(Sender: TObject); end;var Form1: TForm1;implementation{$R *.fmx}var bindExpression1, bindExpression2: TBindExpression;procedure TForm1.FormCreate(Sender: TObject);begin bindExpression1 := TBindExpression.Create(BindingsList1); bindExpression2 := TBindExpression.Create(BindingsList1); with bindExpression1 do begin ControlComponent := Label1; ControlExpression := 'Text'; SourceComponent := Edit1; SourceExpression := 'Text'; // Active := True; end; with bindExpression2 do begin ControlComponent := Label2; ControlExpression := 'Text'; SourceComponent := Edit1; SourceExpression := 'UpperCase(Text)'; // Active := True; end;end;procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);begin bindExpression1.Evaluate;end;procedure TForm1.Edit1Change(Sender: TObject);begin bindExpression2.Evaluate;end;end.
联系客服