changing form style or borderType at runtime

Is it possible to change a forms style or borderType at runtime???

In 2.2 you can do a

application.overrideStyle(old style, new style)

HOWEVER - this should be called as part of the opening method (before the forms load if possible).

Bob,

What I want to do is show a 5pt red border whenever the user goes into find mode and then turn it off when they leave.

I have this working using a 5pt red line image that I hide and show as needed, but changing the border would be nicer.

Do you think application.overrideStyle(old style, new style) would work as part of an event in an open form?

Hi - no you won’t be able to just keep changing styles during runtime.

You can’t really do what you want - but you can do things like change the background color, foreground color, etc easily.

OK.

What is the proper syntax to use when changing the background color at runtime?

I tried:

forms.people.backgroundColor = “red”

but it doesn’t seem to work.

Also, I can open an existing style but I can’t seem to edit it. Any idea why?

Thanks for your help!

HOT TIP: Don’t TYPE - CLICK! :D

If you see your element in the tree - and double click the bgcolor property - you’ll see something like:

forms.myForm.elements.myField.bgcolor

THEN - say:

forms.myForm.elements.myField.bgcolor = 'red'

You can also use the ColorChooser (Edit menu in the Editor) to automatically put in the hex color of the exact red you want to use.

Bob,

Your example sets the background color of a FIELD at run-time.

Is it possible to set the background color of a FORM at run-time?

If so, what is the syntax???

Thanks for your help!!!