Hi,
für den Anfang ist das schon mal Klasse,
aber wie gesagt die Sache mit den vielen Buttons und mann kann den Balken nicht wieder hochdrehen.
Die Button sache ist gefixt hier.
Spoiler anzeigen
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
;========================
Global $a_pos_Balken = 1
Global $Pos_Bal_1 = 100
Global $Pos_Bal_2 = 100
Global $Pos_Bal_3 = 100
Global $Pos_Bal_4 = 100
Global $Pos_Del_Bal_1 = 0
Global $Pos_Del_Bal_2 = 0
Global $Pos_Del_Bal_3 = 0
Global $Pos_Del_Bal_4 = 0
Global $iHeight1 = 17, $aHeight1 = 321, $aY1 = 24
Global $iHeight2 = 17, $aHeight2 = 321, $aY2 = 24
Global $iHeight3 = 17, $aHeight3 = 321, $aY3 = 24
Global $iHeight4 = 17, $aHeight4 = 321, $aY4 = 24
;========================
$hGUI = GUICreate("GDI+ Balken mit %", 562, 402)
GUISetOnEvent(-3, "_kill")
GUISetBkColor(0xFFFFFF)
$Input1 = GUICtrlCreateInput($Pos_Bal_1 & " %", 72, 368, 97, 21)
$Input2 = GUICtrlCreateInput($Pos_Bal_2 & " %", 200, 368, 97, 21)
$Input3 = GUICtrlCreateInput($Pos_Bal_3 & " %", 328, 368, 97, 21)
$Input4 = GUICtrlCreateInput($Pos_Bal_4 & " %", 456, 368, 97, 21)
GUISetState(@SW_SHOW)
;=========================================================================
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hPen1 = _GDIPlus_BrushCreateSolid(0xFF000000);Schwarz
$hPen2 = _GDIPlus_BrushCreateSolid(0xFF404040);Grau
$hPen3 = _GDIPlus_BrushCreateSolid(0xFFFF0000);Rot
$hPen4 = _GDIPlus_BrushCreateSolid(0xFFFF6A00);Orange
$hPen5 = _GDIPlus_BrushCreateSolid(0xFFFFD800);Gelb
$hPen11 = _GDIPlus_BrushCreateSolid(0xFF0094FF);Blau
$hPen7 = _GDIPlus_BrushCreateSolid(0xFF4CFF00);Grün
$hPen9 = _GDIPlus_BrushCreateSolid(0xFFFFFFFF);Weiss
_GDIPlus_GraphicsFillRect($hGraphic, 56, 24, 2, 321, $hPen1) ; Linie
_GDIPlus_GraphicsFillRect($hGraphic, 72, 352, 99, 9, $hPen2) ; Position
_GDIPlus_GraphicsFillRect($hGraphic, 80, $aY1, 83, $aHeight1, $hPen3) ; Balken 1
_GDIPlus_GraphicsFillRect($hGraphic, 208, $aY2, 83, $aHeight2, $hPen5) ; Balken 2
_GDIPlus_GraphicsFillRect($hGraphic, 336, $aY3, 83, $aHeight3, $hPen7) ; Balken 3
_GDIPlus_GraphicsFillRect($hGraphic, 464, $aY4, 83, $aHeight4, $hPen11); Balken 4
$iPercent = 5
[/autoit] [autoit][/autoit] [autoit]For $x = 328 To 24 Step -16
_GDIPlus_GraphicsDrawString($hGraphic, $iPercent & "%", 8, $x)
$iPercent += 5
Next
While 1
;========================================================== Links (ENDE)
If _IsPressed("25") And $a_pos_Balken = 1 Then
$a_pos_Balken = 4
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 456, 352, 99, 9, $hPen2)
ElseIf _IsPressed("25") And $a_pos_Balken = 2 Then
$a_pos_Balken = 1
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 72, 352, 99, 9, $hPen2)
ElseIf _IsPressed("25") And $a_pos_Balken = 3 Then
$a_pos_Balken = 2
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 200, 352, 99, 9, $hPen2)
ElseIf _IsPressed("25") And $a_pos_Balken = 4 Then
$a_pos_Balken = 3
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 328, 352, 99, 9, $hPen2)
;========================================================== Oben
ElseIf _IsPressed("26") And $a_pos_Balken = 1 Then
If $Pos_Bal_1 = 100 Then
Sleep(1)
Else
$Pos_Bal_1 += 5
GUICtrlSetData($Input1, $Pos_Bal_1 & " %")
EndIf
ElseIf _IsPressed("26") And $a_pos_Balken = 2 Then
If $Pos_Bal_2 = 100 Then
Sleep(1)
Else
$Pos_Bal_2 += 5
GUICtrlSetData($Input2, $Pos_Bal_2 & " %")
EndIf
ElseIf _IsPressed("26") And $a_pos_Balken = 3 Then
If $Pos_Bal_3 = 100 Then
Sleep(1)
Else
$Pos_Bal_3 += 5
GUICtrlSetData($Input3, $Pos_Bal_3 & " %")
EndIf
ElseIf _IsPressed("26") And $a_pos_Balken = 4 Then
If $Pos_Bal_4 = 100 Then
Sleep(1)
Else
$Pos_Bal_4 += 5
GUICtrlSetData($Input4, $Pos_Bal_4 & " %")
EndIf
;========================================================== Rechts (ENDE!!!)
ElseIf _IsPressed("27") And $a_pos_Balken = 1 Then
$a_pos_Balken = 2
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 200, 352, 99, 9, $hPen2)
ElseIf _IsPressed("27") And $a_pos_Balken = 2 Then
$a_pos_Balken = 3
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 328, 352, 99, 9, $hPen2)
ElseIf _IsPressed("27") And $a_pos_Balken = 3 Then
$a_pos_Balken = 4
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 456, 352, 99, 9, $hPen2)
ElseIf _IsPressed("27") And $a_pos_Balken = 4 Then
$a_pos_Balken = 1
_GDIPlus_GraphicsFillRect($hGraphic, 64, 344, 499, 17, $hPen9)
_GDIPlus_GraphicsFillRect($hGraphic, 72, 352, 99, 9, $hPen2)
;========================================================== Unten (ENDE!!!)
ElseIf _IsPressed("28") And $a_pos_Balken = 1 Then
If $Pos_Bal_1 = 0 Then
Sleep(1)
Else
$Pos_Bal_1 -= 5
GUICtrlSetData($Input1, $Pos_Bal_1 & " %")
If $iHeight1 = 337 Then ; non Input delete Mode
Sleep(1)
Else
$iHeight1 += 16
_GDIPlus_GraphicsFillRect($hGraphic, 72, 8, 97, $iHeight1, $hPen9)
EndIf
EndIf
ElseIf _IsPressed("28") And $a_pos_Balken = 2 Then
If $Pos_Bal_2 = 0 Then
Sleep(1)
Else
$Pos_Bal_2 -= 5
GUICtrlSetData($Input2, $Pos_Bal_2 & " %")
If $iHeight2 = 337 Then ; non Input delete Mode
Sleep(1)
Else
$iHeight2 += 16
_GDIPlus_GraphicsFillRect($hGraphic, 200, 8, 99, $iHeight2, $hPen9)
EndIf
EndIf
ElseIf _IsPressed("28") And $a_pos_Balken = 3 Then
If $Pos_Bal_3 = 0 Then
Sleep(1)
Else
$Pos_Bal_3 -= 5
GUICtrlSetData($Input3, $Pos_Bal_3 & " %")
If $iHeight3 = 337 Then ; non Input delete Mode
Sleep(1)
Else
$iHeight3 += 16
_GDIPlus_GraphicsFillRect($hGraphic, 328, 8, 99, $iHeight3, $hPen9)
EndIf
EndIf
ElseIf _IsPressed("28") And $a_pos_Balken = 4 Then
If $Pos_Bal_4 = 0 Then
Sleep(1)
Else
$Pos_Bal_4 -= 5
GUICtrlSetData($Input4, $Pos_Bal_4 & " %")
If $iHeight4 = 337 Then ; non Input delete Mode
Sleep(1)
Else
$iHeight4 += 16
_GDIPlus_GraphicsFillRect($hGraphic, 456, 8, 99, $iHeight4, $hPen9)
EndIf
EndIf
Else
Sleep(10)
;==========================================================
EndIf
Sleep(100)
WEnd
Func _kill()
_GDIPlus_BrushDispose($hPen1)
_GDIPlus_BrushDispose($hPen2)
_GDIPlus_BrushDispose($hPen3)
_GDIPlus_BrushDispose($hPen4)
_GDIPlus_BrushDispose($hPen5)
_GDIPlus_BrushDispose($hPen11)
_GDIPlus_BrushDispose($hPen9)
_GDIPlus_BrushDispose($hPen7)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_kill
Labels verwenden ?!
Nee. GDI+ reicht doch.