Ich habe einmal testweise in beiden Methoden (SetActiveControl und SetfocusControl) die Rehenfolge so geändert, wie es mir logisch erschien. Also erst in FLastActiveControl die FActiveControl gemerkt und dann den Wert der von FActiveControl neu gesetzt.
TCustomForm.SetActiveControl:
Code: Alles auswählen
....
// hier eingefügt !!!!!!!!!!!!
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
FLastActiveControl := FActiveControl;
FActiveControl := AWinControl;
// hier entfernt !!!!!!!!!!!!!
//if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
// FLastActiveControl := FActiveControl;
....
TCustomForm.SetFocusedControl:
Code: Alles auswählen
....
// hier eingefügt !!!!!!!!!!!!
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
FLastActiveControl := FActiveControl;
FActiveControl := Control;
// hier entfernt !!!!!!!!!!!!!
//if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
// FLastActiveControl := FActiveControl;
....
Jetzt funktioniert es, wie erwartet.
Habe ich jetzt das Lazarus kaputt gemacht oder einen Bug beseitigt?
Was meint ihr?
.