Hallo unverschämt,
einfach die Prozentzahl in einem transparenten Label über die Progressbat legen, siehe Beispiel:
Spoiler anzeigen
[autoit]#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
[/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]Opt('MustDeclareVars', 1)
[/autoit][/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]Example()
[/autoit][/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]Func Example()
Local $wait, $s, $msg, $m
[/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]Local $hGuiMain = GUICreate("My GUI Progressbar", 220, 100, 100, 200)
[/autoit][/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0) ; Classic-Style
Local $progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7) ; Standard-Windows-Style
Local $Label1 = GUICtrlCreateLabel("", 10, 10, 200, 20, $SS_CENTER)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
GUICtrlSetFont(-1, 12, 1400)
[/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]Local $progressbar2 = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
Local $button = GUICtrlCreateButton("Start", 75, 70, 70, 20)
Local $label2 = GUICtrlCreateLabel("Test", 10, 40, 200, 20, $SS_CENTER)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
GUICtrlSetFont(-1, 12, 1400)
GUISetState(@SW_SHOW, $hGuiMain)
[/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]$wait = 20; wait 20ms for next progressstep
$s = 0; progressbar-saveposition
Do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData($button, "Stop")
For $i = $s To 100
If GUICtrlRead($progressbar1) = 50 Then
MsgBox(0, "Info", "The half is done...", 1)
WinActivate($hGuiMain)
EndIf
$m = GUIGetMsg()
[/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]If $m = -3 Then ExitLoop
[/autoit][/autoit]
[autoit][autoit]
[/autoit][/autoit]
[autoit][autoit]If $m = $button Then
GUICtrlSetData($button, "Next")
$s = $i;save the current bar-position to $s
ExitLoop
Else
$s = 0
GUICtrlSetData($progressbar1, $i)
GUICtrlSetData($progressbar2, (100 - $i))
GUICtrlSetData($Label1, $i)
GUICtrlSetData($Label2, 100-$i)
Sleep($wait)
EndIf
Next
If $i > 100 Then
;GUICtrlSetData($progressbar1, 0)
;GUICtrlSetData($progressbar2, 100)
;$s=0
GUICtrlSetData($button, "Start")
EndIf
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example
[/autoit]
mfg autoBert