AdvEdit and ReturnIsTab

Hi!

edit1      .TabOrder=1
AdvEdit1.TabOrder=2, ReturnIsTab=true

1, edit1 get the focus             
2, give the focus direct to the next control, in OnKeyPress or OnKeyDown
AdvEdit1.SetFocus or SelectNext
3, The AdvEdit1 get the focus from edit1, but instantly give to the next control


TMS 7.7.3.1, WIN7, Delphi XE7

Thanks in advance.

What key do you press in Edit1? Is this the return key? If so, if you change the focus from the OnKeypress event or OnKeyDown event, the actual key message arrives in the new focused control, i.e. AdvEdit and ReturnIsTab = true, this will move the focus to the next control. I'd suggest to use TAdvEdit instead of TEdit and adding custom code or add the code that changes focus in the OnKeyUp event.

1, Yes, Return key.

2, If I use AdvEdit / AdvEditBtn / AdvCombobox,... (no ReturnIsTab) instead of edit, the problem is stay.
The problem up about in TMS CP 7.7.3.0.

The OnKeyUp event usage solved the problem, but previously I use OnKeyDown for this without problem.

It is not recommended to force focus changing from events that are coupled to an underlying sequence of Windows messages. OnKeyUp is the safest place to change focus as it's the result of the last Windows message in the sequence WM_KEYDOWN -> WM_CHAR -> WM_KEYUP

I understand, not recommended.

But about until TMS CP 7.7.3.0 (and before some years) this work perfect, no problem.

That would be lovely, if the TMS controls more standardized. In this case more control's have ReturnIsTab property.

I think I started change the OnKeyDown events to OnKeyUp.

Thanks for all.

It's on the feature request list and being considered to add ReturnIsTab to more edit-style controls.