Jump to content

Puzzled by blank lines in ListView GUI


qwert
 Share

Recommended Posts

Would anyone happen to know why _AddArray appends a couple of blank lines to the contents?

I've only recently started to use some of the update/add features and am at a loss about this effect ... even what to try as a test ... although I did find this good explanation of items and subitems: ListView Items and Subitems

Here's my test script that produces the GUI I've attached:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

Local $array[5][3] = [ ['C:\Program Files','12/01/2016','201'], _
                            ['D:\Au3 Scripts','07/03/2014','301'], _
                            ['F:\Downloads','01/01/2017','101'] ]

$GUI = GUICreate("ListView Test", 400, 320, -1, 180)

$Go = GUICtrlCreateButton("Go", 324, 84, 60, 28)
GUICtrlSetTip(-1, "Select a listview entry and click Go")

$Elements = GUICtrlCreateListView("", 24, 12, 280, 280)

_GUICtrlListView_AddColumn($Elements, "Directory Name", 200)
_GUICtrlListView_AddColumn($Elements, "Date", 76)
_GUICtrlListView_AddColumn($Elements, "Unseen sort", 0)

_GUICtrlListView_AddArray($Elements, $array)    ; where are blank lines coming from?
;_GUICtrlListView_AddArray($Elements, $array)   ; even this results in 2 blank lines

Local $item = _GUICtrlListView_AddItem($Elements, "F:\Newest")
_GUICtrlListView_AddSubItem($Elements, $item, "01/01/2015", 1)
_GUICtrlListView_AddSubItem($Elements, $item, "001", 2)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    Case $Go
        $Line = _GUICtrlListView_GetItemTextString($Elements)
        msgbox(0, "Operation", $Line)
    EndSwitch
WEnd

I'll certainly appreciate any help with this.  Thanks.

 

ListView Blank Lines.PNG

 

Link to comment
Share on other sites

Or let AutoIt manage the size of the array:

Local $array[][] = [ ['C:\Program Files','12/01/2016','201'], _
                          ['D:\Au3 Scripts','07/03/2014','301'], _
                          ['F:\Downloads','01/01/2017','101'] ]

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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