Forum Replies Created
-
AuthorPosts
-
August 28, 2012 at 8:54 pm in reply to: No skin on Modal Form but locks Parent Form when closed #48847MilliParticipant
Hey Hamilton
Alternate Fix no.1 on Thread 7111 works like a charm with AlphaControls 7.68 and Delphi XE2.
Thanks once again for your help.
Milli
'Hamilton' wrote:The alternative fix suggested in thread [topic='7111']7111[/topic] is:
* change the sSkinManager1.SkinningRules.srStdForms property to False.
* place a TsSkinProvider component on each form which should be skinned.
August 28, 2012 at 8:42 pm in reply to: No skin on Modal Form but locks Parent Form when closed #48846MilliParticipantHey Hamilton.
Thank you very much for the reply and also for adding in the try…finally statement. I did as you suggested below and all the AlphaControls components still lock on the Main Form when I close the SecondForm.
I am using Delphi XE2 as my IDE so maybe this is why you can't reproduce it with Delphi 2010.
I will try the alternative fix suggested in thread 7111 and let you know how I get along.
Thanks once again for your help Hamilton, it is highly appreciated.
Milli
'Hamilton' wrote:Hi Milli,
I cannot repro this fault using AC768 in Delphi 2010. I set up a sample app as you suggested and it worked fine – but I have huge reservations about the way you've implemented this and aren't surprised that there might be issues because the flow control you've setup is telling the SkinManager to skin Form2 just as it is being closed – which should probably work in theory but is courting problems because it will just take one control with incorrect state flags to cause an AV, and also because it will cause the main form to be non skinned which is not what you intend from what I understand.
I think the recommended approach is to set the form tag to -98. However, I just tested this also and it doesn't work for me. If I set the tag for Form2 to -98 then it and it's controls are still skinned. Ideally this would be fixed.
Serge: can you look into this please? The -98 tag doesn't seem to turn off skinning for a form OR control, at least not as I've understood it should work from your post [topic='7111']7111[/topic]
What I think you should perhaps try is to move the SkinManager control logic off the sub form and onto the main form, like this:
NOTE: I couldn't help but add a try..finally loop for the create/destroy flow and replaced Form.Free with Form.Release as is recommended in the Delphi help.
Code:procedure TFormMain.stbsht2ClickBtn(Sender: TObject);
begin
try
SkinManager.Active := False;
SecondForm := TSecondForm.Create(nil);
SecondForm.ShowModal;
finally
SecondForm.Release;
SkinManager.Active := True;
end;
end;Good luck!
Regards,
Hamilton
-
AuthorPosts