Jump to content

Recommended Posts

Posted

I am trying to create a GUI with several buttons. One of them is the most important one, and I'd like to show that clearly by changing the background and text colors. However it does not seem to work.

I am using the GUICtrlSetBkColor and GUICtrlSetColor functions. I think that I tried something similar some time ago, but it was when the GUI stuff was not still stable so I thought that it simply was a bug that had not been fixed yet.

Does anyone know if it is possible to do this and if not why? It seems like a pretty important limitation...

Cheers,

Angel

Posted (edited)

No, you can't colorize buttons, at least for now. Some time ago I'm also stuck with this problem. You can try to emulate button with label. In my script I used this code:

GUICtrlCreateLabel("", 15, 400, 150, 30, BitOr($WS_DISABLED, $SS_BLACKFRAME))
$btn = GUICtrlCreateLabel("Button", 16, 401, 148, 28, BitOr($SS_CENTER, $SS_CENTERIMAGE)); this one will notify
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, $bgcolor)

This will give flat "button" with the black frame and hand cursor.

Edit: small fixes

Edited by Lazycat
Posted

Thanks a lot for the tip, Lazycat. I will try it out.

Does anybody know why it is not possible to change button colors? Is this a windows limitation?

Angel

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...