Forum Discussion

cauline's avatar
cauline
Contributor
8 years ago

Change Button color property in Userform

I am unable to change the color property for a TcxButton type:

 

UserForms.AppMain.RunScript.Colors.Pressed = clRed;

 

What is the appropriate way to set the button color property?

 

Thank you.

C

5 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Before setting the color for button you must make the cxbcPressed flag to true as below

     


     

     

    • cauline's avatar
      cauline
      Contributor

      I am unable to set this property in the script.  It is not available:

       

      Error The object does not support this property or method. Error location: Unit: "TC.G2_0\UlineTestApp\Script\MainForm" Line: 20 Column: 50.

      Error
      The object does not support this property or method.
      • shankar_r's avatar
        shankar_r
        Community Hero

        caulineI have edited my post, As per my understanding there is no way to set cxbcPressed value thru script.

         

        You should make flag to true during design itself.

         

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Custom button colors are only used when using the Windows Classic theme or TestComplete UI theme Standard, Enhanced or Flat. I'm afraid this is by design.