Jump to content

[HELP] Collecting subdata with "_GUI Ctrl Get ListView Item Text"


Go to solution Solved by Nine,

Recommended Posts

Posted
Hello, I need your help. There is a small problem that I cannot solve, although it may be simple for you. How can I add the $size variable each time and get the result to 100? Thnx for help . I cant speak english i use google translate , sorry for my bad english.
 
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

Example()

Func Example()
        Local $idListview
        GUICreate("try", 400, 300)
        $idListview = GUICtrlCreateListView("try|sub|", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)
        For $i = 0 to 10
            _GUICtrlListView_AddItem($idListview, "try")
            _GUICtrlListView_AddSubItem($idListview, $i, "10", 1)
            $size = 0
            $size += _GUICtrlListView_GetItemText($idListview, $i, 1)
            $i += 0
        Next
            MsgBox("64", "info", $size)
            
        Do
            Until GUIGetMsg() = $GUI_EVENT_CLOSE
            GUIDelete()
EndFunc
  • Solution
Posted
#include <GUIConstants.au3>
#include <GuiListView.au3>

Example()

Func Example()
  GUICreate("try", 400, 300)
  Local $idListview = GUICtrlCreateListView("try|sub|", 2, 2, 394, 268)
  GUISetState(@SW_SHOW)
  Local $size = 0
  For $i = 0 To 9
    _GUICtrlListView_AddItem($idListview, "try")
    _GUICtrlListView_AddSubItem($idListview, $i, "10", 1)
    $size += _GUICtrlListView_GetItemText($idListview, $i, 1)
  Next
  MsgBox("64", "info", $size)

  Do
  Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

You were close...

Posted (edited)

I want to collect the "addsubitem" part that I added to the list.

I want all of the "addsubitems" I have to be collected and displayed as a result.

Edited by ufukkreis853
Posted

I didn't see this, you are great man thnx Nine!

23 hours ago, Nine said:
#include <GUIConstants.au3>
#include <GuiListView.au3>

Example()

Func Example()
  GUICreate("try", 400, 300)
  Local $idListview = GUICtrlCreateListView("try|sub|", 2, 2, 394, 268)
  GUISetState(@SW_SHOW)
  Local $size = 0
  For $i = 0 To 9
    _GUICtrlListView_AddItem($idListview, "try")
    _GUICtrlListView_AddSubItem($idListview, $i, "10", 1)
    $size += _GUICtrlListView_GetItemText($idListview, $i, 1)
  Next
  MsgBox("64", "info", $size)

  Do
  Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

You were close...

 

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...