Jump to content
Sign in to follow this  

How to make a ListView with Checkboxes?

Recommended Posts



I had a script which contained a ListView with Checkboxes. Unfortunately, I deleted it. :)

Now i can't recreate it. I tried the following piece of code and similar things from the forum:

#include <GuiConstants.au3>
#include <GuiListView.au3>
Opt("GuiOnEventMode", 1)
Opt("GUICloseOnESC", 0)

$gui_main = GUICreate("", 500, 300)
GUISetOnEvent($gui_event_close, "_quit")
GUISetFont(9, 400, 0, "Tahoma")

$list = GUICtrlCreateListView("Col1|Col2", 20, 20, 300, 200)
_GUICtrlListView_SetExtendedListViewStyle(-1, $lvs_ex_checkboxes)

While 1

Func _quit()

The problem is: I get a ListView with two columns Col1 and Col2, but no checkboxes at all...

Could someone tell me, what's wrong here? Any help would be appreciated very much... thanks.


Share this post

Link to post
Share on other sites


GuiCreate('Wallpaper Rotater Configuration', 500, 406) 
GuiCtrlCreateLabel('Your current pictures:', 10, 0, 195, 25, $SS_CENTERIMAGE) 

$lstDirectories = GuiCtrlCreateListView('Name|Directory|Position', 10, 25, 395, 200, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER), BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT))
    _GUICtrlListView_SetColumnWidth($lstDirectories, 0, 150)
    _GUICtrlListView_SetColumnWidth($lstDirectories, 1, 245)
    _GUICtrlListView_SetColumnWidth($lstDirectories, 2, 100)
_GuiCtrlListView_AddItem($lstDirectories, 'Hello')

While GuiGetMsg() <> -3 

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post

Link to post
Share on other sites

yeah, i just figured it out, as you wrote your answer. :)

i think, my brain isn't working at 100% at the moment... maybe i should go to bed.

Edited by Der_Andi

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.