Jump to content

_GUICtrlListView_GetItemText problem


Kyme
 Share

Recommended Posts

Hello all
I have a really strange problem with what i'm dealing with, and i don't understand if i'm doing something wrong or it's a bug
given code is:

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
local $nodata[2][4]=[["No Data1", "N/A1", "N/A2", "N/A3"],["No Data2", "N/A1", "N/A2", "N/A3"]]
Global $index[3]=["0","1","3"]
Global $index2=0

Example()
Func Example()
    Local $idListview

    GUICreate("ListView Get Item Text", 400, 300)
    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

   _GUICtrlListView_AddColumn($idListview, "Item", 100)
   _GUICtrlListView_AddColumn($idListview, "Item", 100)
   _GUICtrlListView_AddColumn($idListview, "Item", 100)
   _GUICtrlListView_AddColumn($idListview, "Item", 100)

   _GUICtrlListView_AddArray ($idListview, $nodata )

   MsgBox($MB_SYSTEMMODAL, $index2, _GUICtrlListView_GetItemText($idListview, $index2,0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index2,1)); it works normally
   MsgBox($MB_SYSTEMMODAL, $index[0], _GUICtrlListView_GetItemText($idListview, $index[0],0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index[0],1)); no data? but $iIndex param it's same


   Do
      Until GUIGetMsg() = $GUI_EVENT_CLOSE
   GUIDelete()
EndFunc

calling _GUICtrlListView_GetItemText with an array index return nothing, why and how can i fix this situation?

A short moment later...
i've tried to cast the param to string, but silly me didn't tought it through till the end, it needs a number, casting it to number fixed it

MsgBox($MB_SYSTEMMODAL, $index2, _GUICtrlListView_GetItemText($idListview, $index2,0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index2,1))
   MsgBox($MB_SYSTEMMODAL, $index[0], _GUICtrlListView_GetItemText($idListview, Number($index[0]),0)&@CRLF&_GUICtrlListView_GetItemText($idListview, Number($index[0]),1));

Thank you

Edited by Kyme
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...