Sign in to follow this  
Followers 0
awrog

'Hot' fields

3 posts in this topic

Hi,

Is it possible to load some data into a listview, and to only display the first two columns and to display the other data in labels below the listview.

And is it possible to synchronize this, e.g., when I move the cursor down one position (or when I select a row with the mouse) that the corresponding values displayed in te labels will be updated?

I hope I am clear and that this is possible!

Arno Rog

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This example uses the beta (see my signature for link)

#include <GuiConstants.au3>
#include <GuiListView.au3>

opt('MustDeclareVars', 1)
Dim $listview, $Btn_Exit, $msg, $ret, $col3, $col4, $hold = -1
GUICreate("ListView Hidden Column", 392, 322)

$listview = GUICtrlCreateListView("col1|col2|col3|col4", 40, 30, 310, 149)
GUICtrlCreateListViewItem("line1|data1|more1|testing1", $listview)
GUICtrlCreateListViewItem("line2|data2|more2|testing2", $listview)
GUICtrlCreateListViewItem("line3|data3|more3|testing3", $listview)
GUICtrlCreateListViewItem("line4|data4|more4|testing4", $listview)
GUICtrlCreateListViewItem("line5|data5|more5|testing5", $listview)
_GUICtrlListViewSetColumnWidth ($listview, 2, 0)
_GUICtrlListViewSetColumnWidth ($listview, 3, 0)
$col3 = GUICtrlCreateLabel("", 40, 190, 100, 20, BitOR($SS_SUNKEN, $SS_CENTER))
$col4 = GUICtrlCreateLabel("", 40, 220, 100, 20, BitOR($SS_SUNKEN, $SS_CENTER))

$Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)

GUISetState()
While 1
    $msg = GUIGetMsg()
    If _GUICtrlListViewGetSelectedCount ($listview) Then
        If $hold <> Int(_GUICtrlListViewGetSelectedIndices ($listview)) Then
            $hold = Int(_GUICtrlListViewGetSelectedIndices ($listview))
            GUICtrlSetData($col3, _GUICtrlListViewGetItemText ($listview, -1, 2))
            GUICtrlSetData($col4, _GUICtrlListViewGetItemText ($listview, -1, 3))
        EndIf
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
    EndSelect
WEnd
Exit
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

gafrost

Perfect! Thanks a million times.

Arno Rog

Share this post


Link to post
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
Sign in to follow this  
Followers 0