The quick and easy way:
Create a transparent text object that covers the button. Apply conditional formatting to the text object making its background color match your layout's background color if Get ( WindowMode ) = find mode or browse mode.
You would also want to set the button's script to immediately exit if the user is in the wrong mode.
You can even apply the conditional formating to the button itself by matching the background color for both fill and text color, until the correct mode is reached, when you apply the custom formats.
Quite right. I had a 'graphical' button on my brain.
If it is a purely text-based button, the text could change to correspond to the layout.