mos Posted October 18, 2017 Share Posted October 18, 2017 I have a frame and a single image on the frame which has it's onClick event set. The code in the onClick event toggles the color of the Frame: procedure TUniFrame1.UniImage1Click(Sender: TObject); begin if Self.Color = clRed then Self.Color := clBtnFace else Self.Color := clRed; end; What happens is that when you click the image the very first time the Frame color is red. However when you click it again to reset the color back to clBtnFace it doesn't change. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 19, 2017 Share Posted October 19, 2017 Hi, Can you make a simple testcase for this ?! Best regards, Quote Link to comment Share on other sites More sharing options...
mos Posted October 19, 2017 Author Share Posted October 19, 2017 Hi Delphi Developer, Attached is a simple test to illustrate the issue. FrameColour.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 19, 2017 Share Posted October 19, 2017 Hi, Thanks for the testcase We will check Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 19, 2017 Share Posted October 19, 2017 "Seems this happens with some colors including clBtnFace" Can you try this approach for now ?!: 1. UniFrame1.Color => $00F0F0F0 2. procedure TUniFrame1.UniImage1Click(Sender: TObject); begin if Self.Color = clRed then Self.Color := $00F0F0F0 else Self.Color := clRed; end; Quote Link to comment Share on other sites More sharing options...
mos Posted October 19, 2017 Author Share Posted October 19, 2017 Hi Delphi Developer, Tried it and it now works. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.