[Lazarus] Is TForm.LastActiveControl working correctly?

Juha Manninen juha.manninen62 at gmail.com
Sun Dec 6 19:01:59 CET 2020

On Sun, Dec 6, 2020 at 1:22 PM frans via lazarus <
lazarus at lists.lazarus-ide.org> wrote:

> ActiveControl and lastActiveControl always point to the same control.

> Is this a bug or is my understanding of lastActiveControl wrong?

That is how it is implemented. It is set to ActiveControl
unless ActiveControl is Nil or a TCustomForm.
  if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
    FLastActiveControl := FActiveControl;

I did not know about LastActiveControl. What is the use of it? TScreen
class seems to have it, too.
Anyway, you can easily keep track of the previous ActiveControl in your
code yourself.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201206/33760c9e/attachment.html>

More information about the lazarus mailing list