Jump to content

Setting button color


Recommended Posts

Greetings,

I have been using AutoIt for about a week and a half now and decided to start work on the GUI portion of my project. Thought I would try using Koda and the first form I have tried I am unable to set the button color, background or text.

Don't know enough at this point about Gui generation to know if this is a Koda bug or just a user error.

Thanks,

jh

Link to comment
Share on other sites

The setting of button colors is in the latest beta, probably koda hasn't been changed to reflect this.

i.e.

#include <GUIConstants.au3>

GUICreate("My GUI background color")  ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel ("my label", 10,20)
GUICtrlSetBkColor(-1,0x00ff00)  ; Green
GUICtrlCreateButton("Test",10,40,90,25)
GUICtrlSetBkColor(-1,0x00000)
GUICtrlSetColor(-1,0xffffff)
                
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

lol... big on words huh???

did you give it a try??

8)

Spent about 15 minutes working with it. No directory, no skin file, etc, typical newbie errors. I like the looks of it so I bookmarked it and will use it later. Right now I have more basic issues to get past, like my very first GUI design. Remember what happened to Alice when she looked at a GUI designed by Dilbert? Right now I am Dilbert, with no feel for laying out a GUI.

Thanks for posting,

jh

Link to comment
Share on other sites

The setting of button colors is in the latest beta, probably koda hasn't been changed to reflect this.

i.e.

#include <GUIConstants.au3>

GUICreate("My GUI background color")  ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel ("my label", 10,20)
GUICtrlSetBkColor(-1,0x00ff00)  ; Green
GUICtrlCreateButton("Test",10,40,90,25)
GUICtrlSetBkColor(-1,0x00000)
GUICtrlSetColor(-1,0xffffff)
                
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Thanks for posting, ga.

jh

Link to comment
Share on other sites

I tried some things out the last days with using themes/visual styles and it seems not do difficult.

However, with these API-functions one you can only change the text color ie. of a button - logical, cause the theme stuff is based on images.

(BTW: the GUIRegisterMsg-sample in the helpfile to start from was from me and it took me a lot of time too to read a lot of coding stuff and trying things out :()

However, Gary wrote the very good UDF :P

And so why not just use the UDF again - whats the problem to use it? :shocked:

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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