Jump to content

Recommended Posts

Posted

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

Posted

The text should be easy to set, while you have focus on the button, click on caption in the object inspector.

For colored buttons, try searching the forum. I know i've seen them somewhere

Posted

Thanks for posting.

I see now that my post was unclear. I meant that I could not set the color for the button text or the color for the button background. I was hoping I could set the color using Koda.

jh

Posted

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.

 

Posted

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

Posted

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

Posted

It's doable with the latest Beta, but the buttons don't have the "3D look" when colors are applied :shocked:

I noticed that too! ...Gary put a lot of time into that one, but i don't think the "3D" effect is available with colors

AFAIK

8)

NEWHeader1.png

Posted

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:

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...