Tach zusammen, stehe mal wieder vor einem Rätsel, das Ihr bestimmt schnell lösen könnt.
Möchte von einer Combobox etwas auswählen und den Eintrag mit einer Variablen Vergleichen, aber irgendwie ruft er nicht mal meine Funktion auf, bzw wenn er sie mal aufruft, dann liest er das Combofeld nicht aus. Wo ist mein Fehler ??
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$x=1
DIM $artikel[100]
DIM $bestandalt[100]
DIM $liste
_lesen()
_fuellen()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 168, 192, 124)
$Combo1 = GUICtrlCreateCombo($artikel[0], 32, 64, 329, 25)
$Combo1 = GUICtrlSetData(-1, $liste, $artikel[0])
$aktuell = GUICtrlCreateInput("aktuell", 384, 64, 49, 21)
$neu = GUICtrlCreateInput("neu", 464, 64, 49, 21)
$OK = GUICtrlCreateButton("Übernehmen", 536, 64, 81, 25, $WS_GROUP)
$Exit = GUICtrlCreateButton("Beenden", 272, 112, 113, 33, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("TonerTyp auswählen:", 32, 40, 153, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("aktuell", 392, 40, 35, 17)
$Label3 = GUICtrlCreateLabel("neu", 472, 40, 22, 17)
$Label4 = GUICtrlCreateLabel("Tonerbestand", 400, 16, 101, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Exit
Exit
Case $Combo1
GUICtrlSetData ( $aktuell, _anzeigen())
EndSwitch
WEnd
Func _lesen()
While $x <= 99
$artikel[$x] = IniRead ("\\printserver\c$\NSClient++\nrpe\Tonerstandplugin.ini", "TonerTyp"&$x, "Tonerartikel", "0")
$bestandalt[$x] = IniRead ("\\printserver\c$\NSClient++\nrpe\Tonerstandplugin.ini", "TonerTyp"&$x, "Tonerbestand", "0")
$x = $x + 1
WEnd
EndFunc
Func _fuellen()
$x = 1
$liste = $artikel[$x]
$x= 2
While $x <= 99
$liste = $liste &"|"& $artikel[$x]
$x = $x +1
WEnd
EndFunc
Func _anzeigen()
$auswahl = GUICtrlRead ($Combo1)
$i = 0
$x =1
While $i = 0
If $auswahl = $artikel[$x] Then $i = 1
$x = $x +1
WEnd
$toneraktuell = $bestandalt[$x]
Return $toneraktuell
EndFunc
Bin wie immer für jeden Tipp dankbar.
Grüße
CrazyER