tbaror Posted May 27, 2008 Share Posted May 27, 2008 Hello all, i have treeview checkbox style with multiple choices i am looking for the best way to retrieve the chekboxes selected function thanks in advances. $ClentL = GUICtrlCreateTreeView(32, 192, 225, 401, BitOr(256,55)) GUICtrlSetFont($ClentL, 8, 800, 0, "MS Sans Serif") Link to comment Share on other sites More sharing options...
rasim Posted May 27, 2008 Share Posted May 27, 2008 _GUICtrlTreeView_GetChecked() Link to comment Share on other sites More sharing options...
tbaror Posted May 27, 2008 Author Share Posted May 27, 2008 Hi, I am using the function _GUICtrlTreeView_GetChecked when testing even when check box is checked i still get result false please advise thx For $x = 0 To UBound($StTreeArr) -1 MsgBox(0,"test",$stat) $stat = _GUICtrlTreeView_GetChecked ($ClentL, $StTreeArr[$x]) If $stat = True Then MsgBox(4160, "Information", "Selection? " & _GUICtrlTreeView_GetText ($ClentL, $StTreeArr[$x])) EndIf Next Link to comment Share on other sites More sharing options...
rasim Posted May 27, 2008 Share Posted May 27, 2008 Quick example: expandcollapse popup#include <GuiConstantsEx.au3> #include <TreeViewConstants.au3> #include <GuiTreeView.au3> $Style = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, _ $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) $hGUI = GUICreate("Test GUI", 300, 200) $TreeView = GUICtrlCreateTreeView(10, 10, 100, 180, $Style) Global $aItems[11] $aItems[0] = 10 For $i = 1 To $aItems[0] $aItems[$i] = GUICtrlCreateTreeViewItem("Item " & $i, $TreeView) Next $GetButton = GUICtrlCreateButton("Get selected", 200, 160, 80, 23) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GetButton MsgBox(0, "Selected Items:", _GetChecked()) EndSwitch WEnd Func _GetChecked() Local $iSelected For $i = 1 To $aItems[0] If _GUICtrlTreeView_GetChecked($TreeView, GUICtrlGetHandle($aItems[$i])) Then $iSelected &= $aItems[$i] & @LF Next Return $iSelected EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now