Backcolor

Im used to web apps: so I’m having a spot of confusion with desktop apps.

I have added two constants to the App class:

App.MyRed as color App.MyWhite as color

Im trying to set the background of a Text Field using:

textfield1.backcolor=App.MyRed

What am I doing wrong?

Did you set the constant type to color and set it’s value to FF,0,0 for red and ff,ff,ff for white?

Yes Of Course: But the IDE does not recognize it is there. The type ahead is completely dead.

I CAN call (Which solves my problem)

BackColor=&cFFFFFF

But why cant I call:

BackColor.App.mywhite?

App.MyWhite is set to r=&cFFFFFF

there are three buttons for the beside the constant name field… a globe, a warning sign and a red circle with a line through it…
Make sure the first one (the globe) is selected and then the constant should be global…

Hello Jay, if you are running the Windows version of Xojo then there is a bug which prevents the BackColor property of TextFields and TextAreas appearing in the IDE (see <https://xojo.com/issue/25083>). The colour should display correctly when you run the application.

[quote=20589:@Jay Menna]Im used to web apps: so I’m having a spot of confusion with desktop apps.

I have added two constants to the App class:

App.MyRed as color App.MyWhite as color

Im trying to set the background of a Text Field using:

textfield1.backcolor=App.MyRed

What am I doing wrong?[/quote]
This all works fine for me. When I run the project, the TextField is red. I also see App.MyRed in autocomplete when I type “App.”

This is probably just a typo, but shouldn’t the above code be

BackColor = App.mywhite