Hi,
kann mir einer Sagen wie ich auf eine Progrssbar einen Text zusätzliche einfügen kann. Also die Progressbar soll sich füllen und dabei soll noch als Text auf der Progressbar der aktuelle Füllstand in Prozent angezeigt werden.
Hi,
kann mir einer Sagen wie ich auf eine Progrssbar einen Text zusätzliche einfügen kann. Also die Progressbar soll sich füllen und dabei soll noch als Text auf der Progressbar der aktuelle Füllstand in Prozent angezeigt werden.
Einfach transparent ein Label über die Progressbar legen:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
Global $iPercent, $iCount = 1
$hGui = GUICreate('Test', 400, 300)
$hProgress = GUICtrlCreateProgress(10, 10, 380, 20)
$hLabel = GUICtrlCreateLabel('0%', 160, 13, 100, 16)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
$iTimer = _Timer_SetTimer($hGui, 50, '_Counter')
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_Timer_KillTimer($hGui, $iTimer)
Func _Counter($hWnd, $Msg, $iIDTimer, $dwTime)
$iPercent += $iCount
GUICtrlSetData($hLabel, $iPercent & '%')
GUICtrlSetData($hProgress, $iPercent)
If $iPercent = 100 Or $iPercent = 0 Then $iCount = -$iCount
EndFunc
Manchmal ist es doch einfach als man denk. Dankesehr :).