Guten Morgen,
ich möchte gerne eine Progress als Slider nutzen, hab mir dann durch die SuFu diesen Code zusammengestrickt.
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <Misc.au3>
$hGui = GUICreate("", 400, 100)
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
$hProgress1 = GUICtrlCreateProgress(10, 20, 350, 20)
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
$hProgress2 = GUICtrlCreateProgress(10, 60, 350, 20)
$hLabel1 = GUICtrlCreateLabel("0%", 365, 22, 35, 20)
$hLabel2 = GUICtrlCreateLabel("0%", 365, 62, 35, 20)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYDOWN
$aInfo = GUIGetCursorInfo($hGui)
Switch $aInfo[4]
Case $hProgress1
While _IsPressed("01")
$aInfo = GUIGetCursorInfo($hGui)
$aPos = ControlGetPos($hGui, "", $hProgress1)
$iPercent = Int(100 / $aPos[2] * ($aInfo[0] - $aPos[0]))
GUICtrlSetData($hProgress1, $iPercent)
If $iPercent >= 0 And $iPercent <= 100 Then GUICtrlSetData($hLabel1, $iPercent & "%")
WEnd
Case $hProgress2
While _IsPressed("01")
$aInfo = GUIGetCursorInfo($hGui)
$aPos = ControlGetPos($hGui, "", $hProgress2)
$iPercent = Int(100 / $aPos[2] * ($aInfo[0] - $aPos[0]))
GUICtrlSetData($hProgress2, $iPercent)
If $iPercent >= 0 And $iPercent <= 100 Then GUICtrlSetData($hLabel2, $iPercent & "%")
WEnd
EndSwitch
EndSwitch
WEnd
Nun ist es so. Der obere Progress kommt flüssig hinterher mit der Maus. Nun möchte ich aber den neuen Style nutzen, also den Unteren. Aber dort läuft der Balken der Maus hinterher und es dauert bis er angelangt ist. Was kann ich da machen, dass er genauso schnell ist wie der Obere?