Sign in to follow this  
Followers 0
James

Progress Bar Style

10 posts in this topic

Hi,

My latest program uses Progress Bars :) Anyways, my problem is that once I have set a style to it, I can't change it.

I used:

For $i = 1 To $_AllD[0]
    $Labels[$i] = GUICtrlCreateLabel(StringUpper($_AllD[$i]), 20, ($i * 20) + 140, 121, 17)
    $Progress[$i] = GUICtrlCreateProgress(40, ($i * 20) + 140, 121, 17, IniRead($Config_File, "Scheme", "Progress", "1"))
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Progress[$i]), "wstr", "", "wstr", "")
    If Not FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], 0x94FF00)
        GUICtrlSetBkColor($Progress[$i], 0xFFFFFF)
    ElseIf FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], IniRead($Config_File, "Scheme", "Front", ""))
        GUICtrlSetBkColor($Progress[$i], IniRead($Config_File, "Scheme", "Back", ""))
    EndIf
NextoÝ÷ Ù:­æ­zØ^¦º ­ë,mªìjwméȺǶ«,Ëazg­¡Ê'¶º%¶¬·)^°2¢çÇ~º&¶¬)Þjëh×6DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Progress[$i]), "wstr", "", "wstr", "")oÝ÷ Ù8^uçÚº[l·)^Íh­*%ÒÚµêè)æÊ趦Êjw(ÚèØ^²Ü¥x(~Ø^«­¢+Ù
ÍÀÌØí¥5ÍôÀÌØí5}AɽÉÍÍ} ±½¬(%%9½Ð¥±á¥ÍÑÌ ÀÌØí
½¹¥}¥±¤Q¡¸($%}¥±
ÉÑ ÀÌØí
½¹¥}¥±¤(%±Í($%%¹¥]É¥Ñ ÀÌØí
½¹¥}¥±°ÅÕ½ÐíM¡µÅÕ½Ðì°ÅÕ½ÐíAɽÉÍÌÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤($%½ÈÀÌØíèôÄQ¼ÀÌØí}±±lÁt(%U%
ÑɱMÑMÑå± ÀÌØíAɽÉÍÍlÀÌØíét°%¹¥I ÀÌØí
½¹¥}¥±°ÅÕ½ÐíM¡µÅÕ½Ðì°ÅÕ½ÐíAɽÉÍÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ð줤($%9áÐ(%¹%)
ÍÀÌØí¥5ÍôÀÌØí5}AɽÉÍÍ}M½±¥(%%9½Ð¥±á¥ÍÑÌ ÀÌØí
½¹¥}¥±¤Q¡¸($%}¥±
ÉÑ ÀÌØí
½¹¥}¥±¤(%±Í($%%¹¥]É¥Ñ ÀÌØí
½¹¥}¥±°ÅÕ½ÐíM¡µÅÕ½Ðì°ÅÕ½ÐíAɽÉÍÌÅÕ½Ðì°ÅÕ½ÐìÄÅÕ½Ðì¤($%½ÈÀÌØíèôÄQ¼ÀÌØí}±±lÁt($$U%
ÑɱMÑMÑå± ÀÌØíAɽÉÍÍlÀÌØíét°%¹¥I ÀÌØí
½¹¥}¥±°ÅÕ½ÐíM¡µÅÕ½Ðì°ÅÕ½ÐíAɽÉÍÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ð줤($%9áÐ(%¹%

Yet, when I try to change the style to 2 or blocks it doesn't work. However when you set the default style to 2 it works and sets them to blocks.

Any ideas?

Thanks,

James

Share this post


Link to post
Share on other sites



As a shitty workaround have you tried deleting the Ctrl and making a new one with the correct style?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

#include <GUIConstants.au3>

GUICreate("", 400, 200)
$cProgbar = GUICtrlCreateProgress(40, 40, 320, 20, 0)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
$cChkStyle = GUICtrlCreateCheckbox("Smooth", 80, 80, 200, 20)
$i = 0
$t = @SEC

GUISetState()
While 1
    Switch GuiGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $cChkStyle
            If BitAND(GUICtrlRead($cChkStyle), $GUI_CHECKED) Then
                    GUICtrlSetStyle($cProgbar, 1)
                Else
                    GUICtrlSetStyle($cProgbar, 0)
            Endif
    EndSwitch
    If $t <> @SEC Then
        $t = @SEC
        $i += 10
        If $i > 100 Then $i = 0
        GUICtrlSetData($cProgbar, $i)
    EndIf
WEnd

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
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
Sign in to follow this  
Followers 0