0

I'm developing Android mobile application using Delphi XE8 and please help me to do the following implementation.

In a Form, I'm having 3 Components which is the following order 1. TEdit (edtValue1), 2. TEdit (edtValue2), 3. TComboBox (cbxValue1)

When the form is opened I have made:

edtValue.SetFocus;

My doubt is after entering some values in edtValue1, then How can I shift the focus to edtValue2 by pressing the enter Key in the KeyPad in Android mobile. Also If I need to shift the focus to cbxValue1 after edtValue2, then How can I handle this also.? Please help me in this. Thanks in advance.

test12345
  • 367
  • 1
  • 21
  • Did you set the TabOrder property for the components? There have been [bugs in earlier versions](https://www.google.nl/search?q=firemonkey+taborder), but I expect this to be fixed in XE8. – Jan Doggen Aug 28 '15 at 12:41

1 Answers1

0

Here is a code, which works for controls, you've mentioned:

procedure TForm1.FormCreate(Sender: TObject);
begin
  edtValue1.SetFocus;
end;

procedure TForm1.edtValue1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
  Shift: TShiftState);
begin
  if Key = 13 then
    edtValue2.SetFocus;
end;

procedure TForm1.edtValue2KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
  Shift: TShiftState);
begin
  MouseDown(TMouseButton.mbLeft, [], cbxValue1.AbsoluteRect.CenterPoint.X, cbxValue1.AbsoluteRect.CenterPoint.Y);
end;

May be it is a bit cheaty, but it has good clues to explore.