Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

guictrlread dont read listview

$
0
0

hi  guy i  have program ,  in this prog  i  want  by  a  button open  alittle  listview   with 2 column   select  one  of  item  and  put  in   input  (in principal form )

 

this is a code

AutoIt         
Func _anagrafica_tab2()     $Form2 = GUICreate("Cerca in Anagrafica", 346, 267, 477, 179)     $Input0 = GUICtrlCreateInput("", 16, 40, 185, 21)     $List4 = GUICtrlCreateListView("Nome | ID   ", 5, 74, 332, 149,$LVS_EX_GRIDLINES)     _GUICtrlListView_SetExtendedListViewStyle($List4, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel     GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 280) ; Nome Anagrafica     GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 45) ; ID Nome     $Label1 = GUICtrlCreateLabel("Cerca", 16, 23, 32, 17)     $Button1 = GUICtrlCreateButton("Cerca", 216, 40, 75, 21, 0)     $Button2 = GUICtrlCreateButton("Inserisci", 256, 232, 75, 25, 0)     GUISetState(@SW_SHOW)     GUISetOnEvent($GUI_EVENT_CLOSE, "_chiudi") _SQL_Startup() $l=0 Local $aRow, $iRows, $iCols     _SQLite_GetTable2d($Db, "SELECT * FROM anagrafica;", $aRow, $iRows, $iCols)         For $i = 1 To $iRows - 0         _GUICtrlListView_AddItem($List4, $arow[$i][1], $i) ;nome ditta         _GUICtrlListView_AddSubItem($List4,$l, $arow[$i][0], 1, 1) ; mail          $l=$l+1     Next         _SQLite_Close($Db)         _SQLite_Shutdown()     GUICtrlSetOnEvent($Button1, "_cercaanagrafica_tab2")     GUICtrlSetOnEvent($Button2, "On_Button3") EndFunc   ;==>_anagrafica_tab2 Func On_Button3(); bootone  inserisci anagrafica     Local $test=GUICtrlRead($List4,1)         MsgBox(0,'',$test)     $sSelected_Data = StringTrimRight(GUICtrlRead(GUICtrlRead($List4)), 1)     $string = StringSplit($sSelected_Data, "|") ;Crea un array con le lettere, ogni volta che c' è \ creo un dato     $verifica = $string[1]     If $sSelected_Data <> "" Then         GUICtrlSetData($Input1_tab2, $verifica)     EndIf     GUIDelete($Form2) EndFunc   ;==>On_Button3 Func _cercaanagrafica_tab2()     $testodacercare = GUICtrlRead($Input0)     $iI = _GUICtrlListView_FindInText($List4, $testodacercare)     MsgBox(4160, "Info", "Target: " & $iI)     _GUICtrlListView_EnsureVisible($List4, $iI)     ;_GUICtrlListView_SetItemDropHilited($List4, $iI,True)     _GUICtrlListView_SetItemFocused($List4, $iI,True)     ;GUICtrlSetData($List4,$iI) EndFunc   ;==>_cercaanagrafica_tab2

when i try to read $list4  not read  give me  always  0   :(

 

Local $test=GUICtrlRead($List4,1)
        MsgBox(0,'',$test)

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>