ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


    เปลี่ยนสี Progress Bar

    Arm
    Arm
    PSsix Member Super Class III
    PSsix Member Super Class III


    PSsix Master PSsix Program Coder
    จำนวนข้อความ : 268
    ความนิยม : 54
    เข้าร่วมเมื่อ : 31/03/2011
    อายุ : 26

    เปลี่ยนสี Progress Bar Empty เปลี่ยนสี Progress Bar

    ตั้งหัวข้อ by Arm 13/02/12, 09:42 am

    Code:
    #NoTrayIcon
    #include <GUIConstantsEx.au3>
    $hwnd = GUICreate("", 307, 27, -1, -1, -2138570616)
    $hProgress = GUICtrlCreateProgress(4, 4, 300, 20)
    _ProgressSet_Style_Color(1, 0x0000FF) ;Style smooth = 1, no smooth = 0, HexColor blue = 0x0000FF
    $hLabel = GUICtrlCreateLabel("0%", 150, 8, 50, 50)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState(@SW_SHOW)
    Dim $i = 0
    Do
       GUICtrlSetData($hProgress, $i)
        GUICtrlSetData($hLabel, $i &"%")
        $i += 1
       Sleep(Random(1,200))
       If $i = 50 Then GUICtrlSetColor($hLabel, 0xFFFFFF)
    Until $i > 100
        Sleep(500)
        MsgBox(64, "", "Completed.", 1, $hwnd)
        GUIDelete()
       Exit
    Func _ProgressSet_Style_Color($Style, $HexColor)
        DllCall("UxTheme.dll","int","SetWindowTheme","hwnd", GUICtrlGetHandle($hProgress),"str"," ","str"," ")
        GUICtrlSetStyle($hProgress, $Style)
        GUICtrlSetColor($hProgress, $HexColor)
    EndFunc ;<==ProgressSetThemeStyleColor Library.
    em218

      เวลาขณะนี้ 29/03/24, 04:14 pm