EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Change Color of Button when pressed? (https://www.eq2interface.com/forums/showthread.php?t=18179)

aseop 02-10-2016 12:47 AM

Change Color of Button when pressed?
 
I was thinking it was possible to change the color of the text in a button when the button is pressed by defining a variable then assigning that variable to the Color attribute during OnPress...

Quote:

<button TextColor="#000000" PCOLOR="#FF0000" OnPress="TextColor=(PCOLOR)" >Hello</Button>
But this does not seem to work. Is there a way to do it?

Aseop

Darqwood 02-10-2016 01:08 PM

Depends on what you want to do with it. Buttons have a style that defines, among other things, the color of the text a) when you are not interacting with the button, b) when the mouse is hovering over the button, and c) when the button is disabled. If you look into the button styles you will see a PressedTextColor attribute but I have not used it successfully. MouseOverTextColor seems to override PressedTextColor.

If you want it to stay changed after the mouse moves away from it, you might look at the ToggleButton (which is really a checkbox that looks like a button.) Here you can use OnSet and OnUnset to change the TextColor. OnPress also works, but if you want it to behave like a normal button you will have to do something else, possibly use OnHoverOut to deactivate it and change back to the original color when the mouse exits the button.


.

aseop 02-24-2016 08:30 PM

So I see what you are saying and changing the text color can be done, but you have to change the button style. I tried to use toggle buttons, but the default styles are underwhelming and I did not feel like creating a new one. In the end I added a check box beside the button and had the button check off the check box when pressed and change the color of the text to the right of the button which is essentially an expanded tooltip. For my purposes this works. Thanks again for the advice.


All times are GMT -5. The time now is 07:32 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI