mos Posted October 18, 2017 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.
Sherzod Posted October 19, 2017 Posted October 19, 2017 Hi, Can you make a simple testcase for this ?! Best regards,
mos Posted October 19, 2017 Author Posted October 19, 2017 Hi Delphi Developer, Attached is a simple test to illustrate the issue. FrameColour.zip
Sherzod Posted October 19, 2017 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;
mos Posted October 19, 2017 Author Posted October 19, 2017 Hi Delphi Developer, Tried it and it now works.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now