Loc Posted November 24, 2021 Share Posted November 24, 2021 There are some errors when making the percentage displayed in the progress bar: - When using guictrlsetdata at the same time, the percentage is lost. - Using sleep can display the percentage bar, but when the progress bar = 100, the progress is lost. Please help me find a way to keep this percentage(Label) always showing on progress bar with. Test code is below: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Progress", 367, 148, 192, 124) $Progress = GUICtrlCreateProgress(56, 48, 254, 25) $Percentage = GUICtrlCreateLabel("0%", 66, 48, 233, 25, $SS_CENTER + $SS_CENTERIMAGE) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### For $i = 0 To 100 GUICtrlSetData($Progress, $i) GUICtrlSetData($Percentage, $i & '%') Sleep(10) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks! Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now