[Component].LoadSettingsFromFile error

OS: Debian 10 LXDE 64
Lazarus 2.0.12
FPC 3.2.0

To load a style at runtime there are several options. When you have a style file, you can either load
it via [Component].LoadSettingsFromFile

procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCDockPanel1.LoadSettingsFromFile('TTMSFNCStyle_FNC_Default.style');
end;

TTMSFNCStyle_FNC_Default.style
The style is located in the project directory

Style_LAZ_2_0_12

The LoadSettingsFromFile is for individual component settings/styles, saved via SaveSettingsToFile. you cannot load a general style to a single individual component. Please use the following code:

TMSFNCStylesManager1.LoadStyleFromFile('TTMSFNCStyle_FNC_Dark.style');

This is also shown as a code snippet in the documentation.

I followed your instructions to make the best use of your components.

TMSFNCStylingDevGuide.pdf
" To load a style at runtime there are several options. When you have a style file, you can either load
it via [Component].LoadSettingsFromFile "

What you have suggested is a better approach.

1 Like

Thanks, we'll see if we can update the documentation.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.