Jump to content
Sign in to follow this  
blindwig

Checkboxes in Listview?

Recommended Posts

I remember writing a program once and I needed a variable number of check boxes. After trying to write a routine to handle a variable number of check boxes (placing them, checking and setting them, etc) I found out that you could make a listview box have a check box next to each item in the box.

Is this a normal function of a listview control, or what that some kind of hack?

If it's normal, its there a way to get this functionality in AutoIt?

Share this post


Link to post
Share on other sites

I remember writing a program once and I needed a variable number of check boxes.  After trying to write a routine to handle a variable number of check boxes (placing them, checking and setting them, etc) I found out that you could make a listview box have a check box next to each item in the box.

Is this a normal function of a listview control, or what that some kind of hack?

If it's normal, its there a way to get this functionality in AutoIt?

<{POST_SNAPBACK}>

it's normal, window's listview can even handle images, not sure the listview in the autoit gui can as of yet.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

And yes AutoIt can perfrom List View boxes at this time. Download one of the latest BETA's from the Dev section and search the help file for '_GUICtrlListViewGetCheckedState' or '_GUICtrlListViewSetCheckedState'.


qq

Share this post


Link to post
Share on other sites

See "C:\Program Files\AutoIt3\Examples\GUI\SampleControls.au3"

Screenshot at http://www.autoitscript.com/images/gui_eg1.png

#include <GuiConstants.au3>
GuiCreate("Tree with checkboxes")
GuiSetState()

$treeTwo = GuiCtrlCreateTreeView(95, 90, 103, 80, $TVS_CHECKBOXES)
GuiCtrlCreateTreeViewItem("TreeView", $treeTwo)
GuiCtrlCreateTreeViewItem("With", $treeTwo)
GuiCtrlCreateTreeViewItem("tvs_checkboxes", $treeTwo)
GuiCtrlSetState(-1, $GUI_CHECKED)
GuiCtrlCreateTreeViewItem("Style", $treeTwo)

While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thank you all. And thanks to Cyberslug for pointing out the obvious :( I used the TreeView and TreeViewItems, and because of the way they work, I didn't have to change any code (just the code that creates them) Neat.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...