Jump to content

Progress Bar Style


James
 Share

Recommended Posts

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

Link to comment
Share on other sites

#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"

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