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

How i do txt search in listbox?

$
0
0

Hi friends, i creat one gui and button,  add and remowe ok,

but, I want to find it in the list when I write the word entry, how i do ?

AutoIt         
    #include <ButtonConstants.au3>     #include <EditConstants.au3>     #include <GUIConstantsEx.au3>     #include <GUIListBox.au3>     #include <StaticConstants.au3>     #include <WindowsConstants.au3>     $Form1_1 = GUICreate("  .:|:. Müşteri Kayıt .:|:.", 406, 335, 238, 159)     GUISetBkColor(0x9DB9EB)     $Group1 = GUICtrlCreateGroup("Kayıt", 8, 8, 294, 65)     $Input1 = GUICtrlCreateInput("", 92, 30, 195, 21)     $Label1 = GUICtrlCreateLabel("Adı ve Soyadı:", 16, 32, 72, 17)     GUICtrlCreateGroup("", -99, -99, 1, 1)     $Group2 = GUICtrlCreateGroup("", 312, 8, 81, 65)     $Button1 = GUICtrlCreateButton("Ekle", 325, 25, 55, 17)     $Button2 = GUICtrlCreateButton("Sil", 325, 45, 55, 17)     GUICtrlCreateGroup("", -99, -99, 1, 1)     $Items = GUICtrlCreateList("", 8, 88, 297, 240)     $Dosya = @AppDataDir & "\kisiler.ini"     GuiCtrlSetData(-1, IniRead($Dosya, "kullanıcılar", "adlar", ""))     GUISetState(@SW_SHOW)     #EndRegion ### END Koda GUI section ### Func _ReadItems()     Local $iCnt = _GUICtrlListBox_GetCount($Items)     Local $sMsg = ""     For $n = 0 To $iCnt - 1     $sMsg &= _GUICtrlListBox_GetText($Items, $n) & "|"     Next     Return $sMsg EndFunc     While 1     $nMsg = GUIGetMsg()     Switch $nMsg     Case $GUI_EVENT_CLOSE     Exit Case $Button1 ;ekle     $Dosya = $Dosya     If Not StringInStr(IniRead($Dosya, "kullanıcılar", "adlar", "") & "|", GUICtrlRead($Input1)) Then     IniWrite($Dosya, "kullanıcılar", "adlar", _ReadItems() & GUICtrlRead($Input1))     EndIf     GuiCtrlSetData($Items, "")     GuiCtrlSetData($Items, IniRead($Dosya, "kullanıcılar", "adlar", "")) Case $Button2 ;sil     $Dosya = $Dosya     Global $MusteriData = StringStripWS(IniRead($Dosya,"Kullanıcılar","Adlar",""), 3)     $Gread = StringStripWS(GUICtrlRead($Items), 3)             If $Gread <> "" And StringInStr("|" & $MusteriData & "|", "|" & $Gread & "|") <> 0 Then                 $MusteriData = StringReplace($MusteriData, $Gread, "")                 $MusteriData = StringReplace($MusteriData, "||", "|")                 If $MusteriData = StringRight($MusteriData,1) = "|" Then $MusteriData = StringTrimRight($MusteriData,1)                 GUICtrlSetData($Items, "")                 GUICtrlSetData($Items, $MusteriData)                 IniWrite($Dosya,"Kullanıcılar","Adlar",$MusteriData)             EndIf     EndSwitch     WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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