Jump to content

Listview with tickboxes


 Share

Recommended Posts

Try this code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#Include <GuiListView.au3> ; UDF!!

Dim $msg, $gui, $list, $listitem

$gui = GUICreate("test", 250, 350)
$list = GUICtrlCreateListView("test", 10, 10, 230, 330, -1, $LVS_EX_CHECKBOXES)
$listitem = GUICtrlCreateListViewItem("testitem", $list)

; Next sentence is to set the width of the column automatically to the largest width of all items
_GUICtrlListView_SetColumnWidth($list, 0, $LVSCW_AUTOSIZE) ; This is not AutoIt native! It's a User Defind Function. Someone made it and AutoIt included this for you! You also need the above include.
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Your specifically looking for this line: $list = GUICtrlCreateListView("test", 10, 10, 230, 330, -1, $LVS_EX_CHECKBOXES)

The last part: $LVS_EX_CHECKBOXES gives the checkboxes to the items.

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
Share on other sites

  • 4 weeks later...

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