Jump to content
Sign in to follow this  
Piyush

help needed with _guictrllistview_addsubitem

Recommended Posts

Piyush

how to know the zero based index of the item if there are many items in the list

and one more question , i want to my script to every time when it is opened read items and subitems from a file how can i do this


[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Share this post


Link to post
Share on other sites
PsaltyDS

how to know the zero based index of the item if there are many items in the list

Do you mean to search for the item, or how to know the index of the last item added, or...what?

If you add the subitems directly after you add the item, _GUICtrlListView_AddItem() returns the index of the new item, which can be used for the subitems:

; Add items with 3 columns
For $n = 0 To 5
    $iIndex = _GUICtrlListView_AddItem($hListView, "Item " & $n & " Col 1", 0)
    _GUICtrlListView_AddSubItem($hListView, $iIndex, "Item " & $n & " Col 2", 1)
    _GUICtrlListView_AddSubItem($hListView, $iIndex, "Item " & $n & " Col 3", 2)
Next

If that's not what you meant, be more specific.

and one more question , i want to my script to every time when it is opened read items and subitems from a file how can i do this

Look at the INI* functions in the help file.

If you want more complexity, try eltorro's XMLDomWrapper.au3 UDF and do it with an XML.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Piyush

Do you mean to search for the item, or how to know the index of the last item added, or...what?

If you add the subitems directly after you add the item, _GUICtrlListView_AddItem() returns the index of the new item, which can be used for the subitems:

; Add items with 3 columns
For $n = 0 To 5
    $iIndex = _GUICtrlListView_AddItem($hListView, "Item " & $n & " Col 1", 0)
    _GUICtrlListView_AddSubItem($hListView, $iIndex, "Item " & $n & " Col 2", 1)
    _GUICtrlListView_AddSubItem($hListView, $iIndex, "Item " & $n & " Col 3", 2)
Next

If that's not what you meant, be more specific.

Look at the INI* functions in the help file.

If you want more complexity, try eltorro's XMLDomWrapper.au3 UDF and do it with an XML.

:)

thanks for help i was waiting for it. i got it what i wanted to do with your example

i just did not knew that _guictrllistview_additem returns the index number. i just wanted the index number of the item i have added. i big thanks to you...


[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.