Ask Your Question

How to change background color for button during runtime?

asked 2018-10-13 17:04:07 +0100

shma_lo gravatar image

When I try to change button background color by, for example, MyDialogue.GetControl("MyButton").getModel.BackgroundColor = RGB(200,200,200) the button doesn't change its color. Button's borders get new color only.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2019-03-02 18:49:44 +0100

musikai gravatar image

On Linux try this for your dialog:

MyDialogue.getPeer().setProperty( "NativeWidgetLook", False )

edit flag offensive delete link more


@musikai Thanks for the code. Works for me.

Ratslinger gravatar imageRatslinger ( 2019-03-02 19:17:25 +0100 )edit

answered 2018-10-14 06:02:31 +0100

Ratslinger gravatar image


Please specify OS & LO version when posting.

In testing (Mint 18.3 with LO v6.1.0.3), I get no change at all - not even border. Can change dialog background though.

Went in to original dialog & set background color for buttons (3 on my test) & in desing mode they are colored in but have no color when the dialog is run.

This is a Bug & you should report it. Did a quick review and did not see one specifically for this.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-10-13 17:04:07 +0100

Seen: 74 times

Last updated: Mar 02