Jump to content

ghenerl questions about GUICtrlCreateListViewItem and more

Recommended Posts

hi guys  

i try to understund is possible have inside of listview  the  item  with a foto  and ceckbox  and one row (the same) colored 

if i understend well (i hope )   with this instruction GUICtrlCreateListViewItem i can crete a listview  with colored 

like this script 

#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <ListviewConstants.au3>
#include <array.au3>
#include <File.au3>

Global $aNames[1]
_FileReadToArray('Benutzer.txt', $aNames, $FRTA_NOCOUNT)

$hGui = GUICreate("LV-Items färben", 220, 400)
$listview = GUICtrlCreateListView("Name|Status|CtrlID", 10, 10, 210, 350, $LVS_REPORT)
For $i = 0 To UBound($aNames) - 1
    $iItem = GUICtrlCreateListViewItem($aNames[$i] & "|Offline", $listview)
    GUICtrlSetData($iItem, "||" & $iItem)

;_GUICtrlListView_SetColumnWidth($listview, 0, 140)
;_GUICtrlListView_SetColumnWidth($listview, 1, 40)
;_GUICtrlListView_SetColumnWidth($listview, 2, 0) ;0 = unsichtbar



;GUICtrlSetColor(-1, 0x22C21F)
;GUICtrlSetColor(-1, 0xAA0000)

While 1


Func _RandomOnOff()
    ;For $i = 0 To _GUICtrlListView_GetItemCount($listview) - 1
        $aItem = _GUICtrlListView_GetItemTextArray($listview, 1)
    ;   _ArrayDisplay($aItem)
        ;If IsArray($aItem) Then
            ;If Random(1, 3, 1) = 1 Then
            ;   GUICtrlSetData($aItem[3], "|Off")
                GUICtrlSetBkColor(8, 0xCCFFCC)
            ;   GUICtrlSetData($aItem[3], "|On")
            ;   GUICtrlSetBkColor($aItem[3], 0x22C21F)
;   If GUICtrlGetState($listview) = 1 Then
;       _GUICtrlListView_SortItems($listview, 0)
;       _GUICtrlListView_SortItems($listview, 1)
;   EndIf
    ;AdlibRegister("_RandomOnOff", Random(5000, 10000, 1))
EndFunc   ;==>_RandomOnOff

but  for insert a foto or pic i must use 

_GUICtrlListView_SetImageList  and  populate a  listview    with _GUICtrlListView_AddSubItem _GUICtrlListView_AddItem   ??

therfore or  you use a first solution or second solution 

i understund correct??  


Edited by faustf
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...