Hallo Gemeinde,
ich habe da ein kleines Problem, dass ich schon gelöst habe, aber mir persönlich gefällt die Lösung nicht ganz, deshalb wollte ich eure Meinung zu dem Script erfragen!
Hier ist das Script:
Spoiler anzeigen
#include <file.au3>
#include <GUIConstants.au3>
#Include <GuiComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListboxConstants.au3>
#include <GUIListBox.au3>
#Include <GuiButton.au3>
#Include <Array.au3>
Global $msg, $var
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("", 250, 250)
[/autoit] [autoit][/autoit] [autoit]$hCombobox = _GUICtrlComboBox_Create($hGUI,"",10,10,100,120,$CBS_DROPDOWNLIST)
$eButton = GUICtrlCreateButton("Enter", 140, 8, 75, 25, $BS_FLAT)
$hList = GUICtrlCreateList("", 10, 50, 230, 190, $WS_VSCROLL + $LBS_SORT)
; GUICtrlSetOnEvent($eButton,"Enter")
GUISetOnEvent($GUI_EVENT_CLOSE, "End")
Opt("GUIOnEventMode", 1)
GUISetState(@SW_SHOW)
Dim $aRecords
If Not _FileReadToArray("liste.txt",$aRecords) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
Dim $ttsystems
If Not _FileReadToArray("ttsystem.txt",$ttsystems) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
Dim $maps
If Not _FileReadToArray("liste2.txt",$maps) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
Dim $meta
If Not _FileReadToArray("meta.txt",$meta) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
For $x = 1 to $aRecords[0]
_GUICtrlComboBox_AddString($hCombobox,$aRecords[$x])
Next
While 1
If _GUICtrlComboBox_GetCurSel($hCombobox) = 0 Then
_GUICtrlListBox_ResetContent($hList)
For $x = 1 to $maps[0]
_GUICtrlListBox_AddString($hList,$maps[$x])
Next
_GUICtrlComboBox_SetCurSel($hCombobox, -1)
EndIf
If _GUICtrlComboBox_GetCurSel($hCombobox) = 1 Then
_GUICtrlListBox_ResetContent($hList)
For $x = 1 to $ttsystems[0]
_GUICtrlListBox_AddString($hList,$ttsystems[$x])
Next
_GUICtrlComboBox_SetCurSel($hCombobox, -1)
EndIf
sleep(1000)
WEnd
Func End()
Exit
EndFunc
Folgendes möchte ich erreichen:
Ich habe eine ComboBox drin, die ihre Strings aus einer txt- Datei ausliest! Wenn ich eine Auswahl treffe soll in Echtzeit, eine Liste erzeugt werden in der Listbox, die auch aus eine txt- Datei ausgelesen wird! Je nachdem welche Auswahl man trifft, wird eine andere Liste angezeigt! Das Problem liegt bei der Auswahl; Wenn ich was auswähle, soll die Liste sofort erzeugt werden, ohne dass ich einen Button extra dafür benutze (Button ist trotzdem eingetragen aus Testzwecken)! Mit diesem Script geht das, aber es ist nicht sonderlich gut; Gibt es vielleicht eine andere Lösung oder vielleicht eine Funktion, die ich übersehen hab?