Command "Darkmode on" Error popup

At this moment I have the ‘DARKMODE ON’ Command running as action after startup in beta version 5016.
When starting the program or the layout designer with this command, the error “Cannot change Visible in OnShow or OnHide” shows up.

Here a screenshot of the error:
5016 DARKMODE ON Command
And here a screenshot of the causing command:

After removing this specific action, mAirlist or the layout designer starts up correctly.

Maybe this can be a solution or at least an idea:
At this moment it is only possible to change to dark mode in the toolbar of mAirlist and the help tab of the database. Could it be possible to have the selection made also inside the configuration application as well? Perhaps under the Gui> General tab. This way the Darkmode startup will also be stored inside the configuration.

Dark Mode is implemented using Delphi’s VCL Styles, and changing the mode (style) will trigger a re-initialization of all windows.

The error you see means that this re-init cannot be performed while the (main) window is still being initialized - that’s the point where the startup actions are processed.

For the moment, please consider this a known issue/limitation. For the future, I must change the processing of the startup actions to a later point when the window is already fully visible.

mAirList will remember the last state of Dark Mode, and restore it when you reopen the app.

Thx for your explenation. I will delete the command in startup sequence.
The reason I tried is that I was doing some testing on saving (backuping) settings/ configurations and load the settings on a new installed pc.

Ok this is a very strange situation for testing, but somehome soon I want several home users to load the main configuration/ settings without me visiting them all at home :wink:
When installing now a new instance of mAirlist, the light skin will be automaticly being picked. Is there a way around this and have the software boot in dark mode by default after the initial install?

Just deploy a preferences.ini file in the config and make sure it has:

[General]
DarkMode=true

I changed the code in build 5018 so that the actions are not executed until the window is fully shown. Now the DARKMODE ON command should also work as a startup action.