Jump to content

Recommended Posts

Posted

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.

Posted

"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;

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...