I have usual code to show modal form. But sometimes happens strange bug captured on picture below. (about once per 10 attempt to show that form) It happens only with custom FireMonkey style "Diamond.style".
My code for setting style (in DPR file):
var
lib: THandle;
RS: TResourceStream;
begin
Application.Initialize;
lib := LoadLibrary('res.dll');
RS := TResourceStream.Create(lib, 'DIAMOND', RT_RCDATA);
try
TStyleManager.SetStyle(TStyleManager.LoadFromStream(RS));
finally
RS.Free;
end;
...
My code for showing form:
formProjectName := TformProjectName.Create(Self);
try
formProjectName.ShowModal;
...
finally
formProjectName.Free;
end;