Search code examples
livecode

A code to write in the script of a button that changes the border line of a text entry field to purple in livecode?


I have a button and text entry field in livecode and I want to write a code in the script of the button to change the border color of the text entry filed to purple ?

is this code right

set the borderColor of field "name of field" to "purple"

I am a beginner in livecode and will appreciate your help :)


Solution

  • Your statement is written correctly. If you were to execute the statement and then look at the borderColor property in the field's property inspector, you would see that it had been set to purple. However, there is something you need to know about fields in LiveCode. When you first create a field, it is set to have a subtle 3-D look to the border, which is a standard look for fields on Mac and Windows. When a LiveCode field is set to 3-D, the color of the border is determined by two separate color properties, the topColor and the bottomColor, which determine the colors of the 3-D bevels on the field. To create a single, solid line border on your field do this:

    set the threeD of field "name of field" to false
    set the borderColor of field "name of field" to "purple"
    

    You will then see the effect you want.