TRzToolButton

Viewing 3 reply threads
  • Author
    Posts
    • #496
      Paweł
      Participant

        Hello,

        How can’I change caption font color when mouse is on button.

        Paul.

      • #497
        Ray Konopka
        Keymaster

          Hi,

          There is no built-in properties to allow this, but you could write event handlers for the OnMouseEnter and OnMouseLeave events and do something like this:

          procedure TForm4.RzToolButton1MouseEnter(Sender: TObject);
          begin
            RzToolButton1.Font.Color := clRed;
          end;
          
          procedure TForm4.RzToolButton1MouseLeave(Sender: TObject);
          begin
            RzToolButton1.Font.Color := clGreen;
          end;

          Ray

        • #498
          Paweł
          Participant

            It’s not working with my code.

            Transparent := True;
            VisualStyle := vsGradient;
            GradientColorStyle := gcsCustom;
            SelectionColorStart := StyleServices.GetStyleColor(scButtonFocused);
            SelectionColorStop := StyleServices.GetStyleColor(scButtonFocused);
            SelectionFrameColor := StyleServices.GetStyleColor(scButtonFocused);

            I need to change font color to white.

          • #560
            Ray Konopka
            Keymaster

              I apologize for the delay in responding. Been rather busy getting new versions of our Raize Software products released.

              Back to your question. From the code you provided, it looks like you are using VCL Styles. Is that correct? Then in that case, the technique I provided above will not work. The reason is because the button is designed to pickup the custom style when active. The default behavior of the TRzToolButton is to pickup the background and font colors from the style. I’m not quite sure what appearance you are trying to achieve since you are essentially getting rid of the gradient and hiding the button frame. What style are you using? and what appearance are you trying to achieve?

              Ray

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.