Jump to content

Changing the color of GUICtrlCreateProgress


Recommended Posts

Hi All,

I want to change the color of GUICtrlCreateProgress

I've tried GUICtrlSetBkColor(-1, 0xff0000) and GUICtrlSetColor(-1, 0x00ff00)

but both appear to have no effect

Does anyone have a solution

i could also use DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) but it will change the complete appearance of the GUI

Thnx

Emiel

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

I don't wanna suppose that you did not refer to the right VAR?

$bar = GUICtrlCreateProgress (10,10,200,20)
GUICtrlSetColor($bar,32250)

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

i could also use DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) but it will change the complete appearance of the GUI

Use SetWindowTheme to change theme of single control. Search forum for examples.

"be smart, drink your wine"

Link to comment
Share on other sites

This will do the trick!!!

#include <GuiConstants.au3>
Global $XS_n

$Gui = GuiCreate("Test")
GUISetBkColor(0x0)

XPStyleToggle(1)
$RadioButton = GUICtrlCreateRadio("Text", 20, 40, 40)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$bar = GUICtrlCreateProgress (100,100,210,20)
GUICtrlSetColor($bar,32250)
XPStyleToggle(0)

GUISetState()

for $x = 1 to 100
    GUICtrlSetData($bar, $x)
    Sleep(100)
Next

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func XPStyleToggle($OnOff = 1)
    If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0
    If $OnOff Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return 1
    ElseIf IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc

8)

NEWHeader1.png

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