Jump to content

search by words in listview1 to sort in another listview2


Recommended Posts

  • Moderators

mickdu59,

Your question is very unclear. The title speaks of 2 ListViews, yet your question speaks of browsers and ini files. Just what exactly do you want to do?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

mickdu59,

The answer is almost certainly "Yes", but without more details it is difficult to give you any real help. How about some examples of what you have listed in the first ListView and how you want to display the "found" words in the second.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

like this ?

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>




Local $idListview, $searchtext, $y, $z, $tmp

GUICreate("ListView Get Item Text", 400, 350)
$idListview = GUICtrlCreateListView("", 2, 2, 194, 268)
$idListview1 = GUICtrlCreateListView("", 202, 2, 194, 268)
$inputbox = GUICtrlCreateInput("", 2, 280, 200, 20)
$button = GUICtrlCreateButton("Search", 212, 280, 50, 20)
GUISetState(@SW_SHOW)

; Add columns
_GUICtrlListView_AddColumn($idListview, "Items", 100)
_GUICtrlListView_AddColumn($idListview, "Desc", 100)
_GUICtrlListView_AddColumn($idListview1, "Copy", 100)
_GUICtrlListView_AddColumn($idListview1, "Desc", 100)
Local $array[] = ["Music", "Video", "Audio"]
Local $drray[] = ["abc","def","ghi","jkl"," "]
For $x = 0 To 50

    _GUICtrlListView_AddItem($idListview, "Item " & $x & " " & $array[Random(0, 3)])
    _GUICtrlListView_AddSubItem($idListview, $x, $drray[Random(0, 3)] & $drray[Random(0, 4)] & $drray[Random(0, 3)] , 1)
Next



; Loop until the user exits.
While 1
    $nmsg = GUIGetMsg()
    If $nmsg = $GUI_EVENT_CLOSE Then ExitLoop
    If $nmsg = $button Then
        $searchtext = GUICtrlRead($inputbox)

        If $searchtext <> "" Then
            _GUICtrlListView_BeginUpdate($idListview1)
            _GUICtrlListView_DeleteAllItems($idListview1)
            
            $y = _GUICtrlListView_GetItemCount($idListview)
            For $x = 0 To $y
                $tmp = _GUICtrlListView_GetItemText($idListview, $x)
                If StringInStr($tmp, $searchtext) Then
                    _GUICtrlListView_SetItemSelected($idListview, $x)
                    _GUICtrlListView_CopyItems($idListview, $idListview1)
                EndIf
            Next
            
            _GUICtrlListView_EndUpdate($idListview1)
        EndIf
    EndIf
WEnd
GUIDelete()

 

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

For auto updating the results i use this:

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>




Local $idListview, $searchtext, $y, $z, $tmp

GUICreate("ListView Get Item Text", 400, 350)
$idListview = GUICtrlCreateListView("", 2, 2, 194, 268)
$idListview1 = GUICtrlCreateListView("", 202, 2, 194, 268)
$inputbox = GUICtrlCreateInput("", 2, 280, 200, 20)
;$button = GUICtrlCreateButton("Search", 212, 280, 50, 20)
GUISetState(@SW_SHOW)

; Add columns
_GUICtrlListView_AddColumn($idListview, "Items", 100)
_GUICtrlListView_AddColumn($idListview, "Desc", 100)
_GUICtrlListView_AddColumn($idListview1, "Copy", 100)
_GUICtrlListView_AddColumn($idListview1, "Desc", 100)
Local $array[] = ["Music", "Video", "Audio"]
Local $drray[] = ["abc", "def", "ghi", "jkl", " "]
Local $FolderCheck, $SrchValueCmp = ''
For $x = 0 To 50

    _GUICtrlListView_AddItem($idListview, "Item " & $x & " " & $array[Random(0, 3)])
    _GUICtrlListView_AddSubItem($idListview, $x, $drray[Random(0, 3)] & $drray[Random(0, 4)] & $drray[Random(0, 3)], 1)
Next



; Loop until the user exits.
While 1
    $SrchValue = GUICtrlRead($inputbox)
    If $SrchValue <> $SrchValueCmp Then
        $SrchValueCmp = $SrchValue
        If StringLen($SrchValue) > 3 Then
            SearchList($SrchValue)
        EndIf
    EndIf
    ;=============================================================================
    $nmsg = GUIGetMsg()
    If $nmsg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
;=============================================================================
Func SearchList($FindText)
    _GUICtrlListView_DeleteAllItems($idListview1)
    $Files = _GUICtrlListView_GetItemCount($idListview)
    For $k = 1 To $Files
        $STRResult = StringInStr(_GUICtrlListView_GetItemText($idListview, $k - 1, 0)&_GUICtrlListView_GetItemText($idListview, $k - 1, 1), $FindText, 0)
        If $STRResult <> 0 Then
            $RandomColor = "0x" & StringRight(Hex(Random(150, 255, 1)), 2) & StringRight(Hex(Random(150, 255, 1)), 2) & StringRight(Hex(Random(150, 255, 1)), 2)
            GUICtrlCreateListViewItem(_GUICtrlListView_GetItemText($idListview, $k - 1, 0) & '|' & _GUICtrlListView_GetItemText($idListview, $k - 1, 1), $idListview1)
            GUICtrlSetBkColor(_GUICtrlListView_GetItemParam($idListview1, _GUICtrlListView_GetItemCount($idListview1) - 1), $RandomColor)
        EndIf
    Next
EndFunc   ;==>SearchList
;=============================================================================

only updates when the input is bigger than 3 characters.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...