Link to home
Start Free TrialLog in
Avatar of harry muharramon
harry muharramon

asked on

Delphi,next focus

hi..

i have one tbutton and 10 tedit , i want every click tbutton focus change to edit1 and click tbutton again focus change to edit2...etc

procedure TForm1.Button3Click(Sender: TObject);
begin
Screen.ActiveForm.Perform(WM_NextDlgCtl, 0, 0);
end;

code above just focus to tedit1 can't focus to next tedit...

thanks...
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
tested previous comments

procedure TForm3.Button1Click(Sender: TObject);
begin
  Perform(WM_NextDlgCtl, 0, 0);
end;

procedure TForm3.SpeedButton1Click(Sender: TObject);
begin
  Perform(WM_NextDlgCtl, 0, 0);
end;

Open in new window


if your button is on that same form, you don't need to roundtrip via the Screen.ActiveForm
Avatar of harry muharramon
harry muharramon

ASKER

TSpeedButton.. its work thanks....