KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to set picture pathname of a button as variable
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: July 18, 2022

The picture pathname of a button object may be set as a picture variable. This could be useful when trying to dynamically display different images for certain scenarios. To set the pathname as a variable, in the “Picture pathname” property of the button object, input “var:” and then the name of the picture variable. For example, given a picture variable “vPic”:



Then, a picture would be loaded from memory to the variable using READ PICTURE FILE, for instance, to display the image on the button.

READ PICTURE FILE(Get 4D folder(Current resources folder)+"pic.jpg"; vPic)