Hallo Community
Ich habe folgendes Problem, unzwar habe ich eine GUI mit einer ListView, einem Button und einem Input. Ich bin am Versuch gescheitert per Buttonklick aus der ListView ein Feld das man makiert hat auszulesen und nur die Spalte Nummer zu nehmen und ins Input zu packen.
[autoit]#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#Include <GuiListView.au3>
$h_Gui = GUICreate("Form1", 203, 299, 192, 124)
$h_ListView = GUICtrlCreateListView("", 8, 8, 185, 214,BitOR($LVS_REPORT, $LVS_NOSORTHEADER, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_VSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
$ListViewHandle = GUICtrlGetHandle(-1)
$h_Objekt_Button = GUICtrlCreateButton("Objekt in Input laden", 8, 232, 187, 25, $WS_GROUP)
$h_Input = GUICtrlCreateInput("", 9, 264, 183, 21)
GUISetState(@SW_SHOW)
_GUICtrlListView_AddColumn($h_ListView,"Nummer",80)
_GUICtrlListView_AddColumn($h_ListView,"Name",80)
Global $File = @ScriptDir & "\List.txt"
If FileExists($File) Then _LoadList()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _LoadList()
$HandleFile = FileOpen($File, 0)
If $HandleFile <> -1 Then
_GUICtrlListView_BeginUpdate($h_ListView)
While True
$Item = FileReadLine($HandleFile)
If @error Then ExitLoop
GUICtrlCreateListViewItem($Item, $h_ListView)
WEnd
_GUICtrlListView_EndUpdate($ListViewHandle)
FileClose($HandleFile)
EndIf
EndFunc
[/autoit]#Edit: Im Anhang noch die List.txt .