constructor TForm1.Create(AOwner: TComponent);
begin
inherited;
TVclStylesSystemMenu.Create(Self);
end;
if you has compile option range check on(the default is false), you will get a runtime error:
Project Project1.exe raised exception class ERangeError with message 'Range check error'.
the reason is here:
if SameText('Windows', s) then
AddMenuSeparatorHelper(FVCLStylesMenu, LSubMenuIndex); //error: use a used LSubMenuIndex for new item
it should be:
if SameText('Windows', s) then
begin
Inc(LSubMenuIndex); //n9p+: use a new index for the Separator
AddMenuSeparatorHelper(FVCLStylesMenu, LSubMenuIndex);
end;
as the document suggestion, write this codes:
constructor TForm1.Create(AOwner: TComponent); begin
end;
if you has compile option range check on(the default is false), you will get a runtime error:
Project Project1.exe raised exception class ERangeError with message 'Range check error'.
the reason is here:
it should be: