Jump to content

Changing UniButton Background Color


mos

Recommended Posts

  • 3 months later...

Hello Sherzod,

If i use a more simple method (CSS), i have the result :

Putting this CSS on ServerModule > CustomCSS   and  bg on Unibutton1 > LayoutConfig > CLS

 

1. This gives the color

.bg {
  background-image: none;  
  background-color: green;
}

 

 

2. This Not :

.bg {
  background-color: green;
}

 

3. If I use a big font then it overlaps

How can i avoid overlap ?

Thx

1.png

Link to comment
Share on other sites

Hello Unigueers,

Please Share your expertise !

 

Many of us don't share any thing, probably thinking it's elementary.
it's wrong !

I keep saying : "Share, Share, Share and more"  ... even if it's simple.  -->  This will save us a lot of time.

So, for Who just come to Unigui world, here is a simple way do set dynamically (at runtime) the Unibutton color Background.

Color Background,  say you ?   Yes ... as it's not obvious at all  (thx to Sherzod) :

 

    with UniButton1.JSInterface do
    begin
      JSCall('btnWrap.setStyle', ['background-image', '"none"']);
      JSCall('btnWrap.setStyle', ['background-color', 'rgb(0,128,128)']);
    end;

 

You can use :  https://www.w3schools.com/css/css_colors_rgb.asp

To convert Colors in rgb  and  rgba format  (a = Alpha = Transparency).

 

  • Like 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...