AhmedV Posted May 2, 2016 Share Posted May 2, 2016 Hello, how can i disable the GuiCtrlCreateMenuItem until it selects an item in the ListView Here, how to keep ($lvitem) disabled/un-clickable until it select the (test) or any item in the ListView? GuiCreate("") $Listv=guictrlcreatelistview("test|testt|testtt",8,8,50,50,-1) $menu=Guictrlcreatecontextmenu($listv) $lvitem=guictrlcreatemenuitem("test", $menu) Guictrlcreatelistviewitem("item1|bla|bla", $Listv) Any help would be appreciated. Link to comment Share on other sites More sharing options...
AutoBert Posted May 2, 2016 Share Posted May 2, 2016 You can use GuiCtrlSetState. Make a full runable reproducer script if you need more help. Link to comment Share on other sites More sharing options...
AhmedV Posted May 2, 2016 Author Share Posted May 2, 2016 9 minutes ago, AutoBert said: You can use GuiCtrlSetState. Make a full runable reproducer script if you need more help. I do using it, but how to Enable the menu item when i try to select an ListViewItem ?? Sorry i just can't write the full script now as i post from my phone. Link to comment Share on other sites More sharing options...
Synapsee Posted May 2, 2016 Share Posted May 2, 2016 (edited) sample from one of my script (can probably help u) : While 1 $Selected = _GUICtrlListView_GetNextItem($ListView) If $ListView <> 0 Then ;Item Selected Msgbox(0,"$Array_ListView[$Selected][0]",$Array_ListView[$Selected][0]) Else ;No Item Selected EndIf WEnd Edited May 2, 2016 by Synapsee code edited Link to comment Share on other sites More sharing options...
AhmedV Posted May 2, 2016 Author Share Posted May 2, 2016 Just now, Synapsee said: sample from one of my script (can probably help u) : While 1 $Selected = _GUICtrlListView_GetNextItem($ListView) + 1 If $ListView <> 0 Then ;Item Selected Msgbox(0,"ListView[$Selected][0]",$ListView[$Selected][0]) Else ;No Item Selected EndIf WEnd Is it ok to use UDF with built-in Commands? Link to comment Share on other sites More sharing options...
Synapsee Posted May 2, 2016 Share Posted May 2, 2016 i think i understand better. look arroud that maybe (i think its exactly what u want) : AhmedV 1 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