Domanda

I use the following code to change the color of particular columns when I open the datewindow up for editing:

dw_1.object.description.Background.Color = RGB(255, 255, 255)

This works great as long as the default background color was not "Transparent" in the painter. If it starts out transparent, this code does nothing.

How can I have the column be transparent, but change it to white and then back again?

Thanks,

È stato utile?

Soluzione

Change the background.mode property to 0 to remove the transparency and take the background.color into account.

The manual says in the Background.property DataWindow object property entry:

Transparent background
If Background.Mode is transparent (1), Background.Color is ignored.

Altri suggerimenti

Set up your column backcolor to white (for example) and set its backcolor expression to 553648127.

After that you may change it with Modify

// To white
dw_1.Modify("description.Background.Color='16777215~t16777215'")
// To transparent
dw_1.Modify("description.Background.Color='16777215~t553648127'")

May be dw_1.SetRedraw(true) will be needed.

You may also create hidden column (desc_bc for example), set its name into expression for backcolor, and change its value instead of calling Modify.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top