Jump to content

Recommended Posts

Posted

Hey everyone,

I'm trying to figure out if it's possible to grey out checkboxes that are in a treeview. I know the $GUI_DISABLE flag is generally used to grey out checkboxes, but that doesn't seem to work in a treeview, or else I'm doing something wrong. Here's non-treeview code that works fine for greying out boxes zero and one:

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

Global $checkbox[3]
$gui = GUICreate("GUI", 650, 450, 200, 150)
$checkbox[0] = GUICtrlCreateCheckbox("zero", 100, 100, 100, 25)
$checkbox[1] = GUICtrlCreateCheckbox("one", 100, 150, 100, 25)
$checkbox[2] = GUICtrlCreateCheckbox("two", 100, 200, 100, 25)
GUISetState()

GUICtrlSetState($checkbox[0],$GUI_DISABLE)
GUICtrlSetState($checkbox[1],$GUI_DISABLE)

While 1
    $guiMsg = GUIGetMsg()
WEnd

And here's code that's nearly identical, but uses a treeview and doesn't grey out the boxes:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>

Global $checkbox[3]
$gui = GUICreate("GUI", 650, 450, 200, 150)
$treeviewStyle = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_CHECKBOXES)

$treeview = GUICtrlCreateTreeView(20, 20, 400, 300, $treeviewStyle)

$checkbox[0] = GUICtrlCreateTreeViewItem("zero", $treeview)
$checkbox[1] = GUICtrlCreateTreeViewItem("one", $treeview)
$checkbox[2] = GUICtrlCreateTreeViewItem("two", $treeview)
GUISetState()

GUICtrlSetState($checkbox[0],$GUI_DISABLE)
GUICtrlSetState($checkbox[1],$GUI_DISABLE)

While 1
    $guiMsg = GUIGetMsg()
WEnd

Any suggestions for what I might be doing wrong or how to fix this?

Thanks so much!

Posted

Hey everyone,

I'm trying to figure out if it's possible to grey out checkboxes that are in a treeview. I know the $GUI_DISABLE flag is generally used to grey out checkboxes, but that doesn't seem to work in a treeview, or else I'm doing something wrong.

treeview checkboxes are internal imagelist bitmaps

have a look at Holgers code

TriState/ThreeState GUI TreeView - Holger

http://www.autoitscript.com/forum/index.php?showtopic=28464

some additional links

http://www.google.ca/search?hl=en&q=tr...earch&meta=

http://groups.google.com/groups?as_q=treev...06&safe=off

I see fascists...

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
×
×
  • Create New...