Skip to main content
Emilmart
Associate III
June 25, 2021
Solved

How to know if a flexbutton has been previously pressed ? (button tag)

  • June 25, 2021
  • 2 replies
  • 744 views

Hi everyone,

I have a button (flexbutton), that should triggers a different action depending on his previous state. For instance, my button should light on or light off a light, depending on his previous state. If the button was previously activated, it switchs the light off, and vice-versa.

In WPF I used a proprety called "tag", which was changing depending on the user actions, but is such thing or similar available in TouchGFX ?

I don't want to use toggle buttons, multiple buttons or create a variable in code.

Thanks!

This topic has been closed for replies.
Best answer by ktrofimo

Sorry, but you have to write this code. Flex button doesn't keep own state ​like Toggle button does. I would suggest to use C++ member inside View class. Or you can use Toggle button with other bitmaps if you do not like existing ones (designer has some styling options).

2 replies

ktrofimo
ktrofimoBest answer
Senior III
June 25, 2021

Sorry, but you have to write this code. Flex button doesn't keep own state ​like Toggle button does. I would suggest to use C++ member inside View class. Or you can use Toggle button with other bitmaps if you do not like existing ones (designer has some styling options).

Emilmart
EmilmartAuthor
Associate III
June 25, 2021

ok thanks, good alternative, hope a tag feature will come in the next release!