musicstashall Posted December 16, 2018 Posted December 16, 2018 How to set a tree item state disable? $tv = GUICtrlCreateTreeView(10, 10, 200, 200, BitOr($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_HASLINES, $TVS_HASLINES, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)) $tvitem1 = GUICtrlCreateTreeViewItem('Item1', $tv) $tvitem2 = GUICtrlCreateTreeViewItem('Item2', $tvitem1) $tvitem3 = GUICtrlCreateTreeViewItem('Item3', $tvitem1) GUICtrlSetState($tvitem1, $GUI_EXPAND) GUICtrlSetState($tvitem2, BitOR($GUI_DISABLE, $GUI_CHECKED)) GUICtrlSetState($tvitem3, BitOR($GUI_DISABLE, $GUI_UNCHECKED))
Nine Posted December 16, 2018 Posted December 16, 2018 @musicstashall That is an interesting enigma. I didn't find any easy way to disable a tree view item beside deleting it. So I started to figure a way to simulate a disable item and it is working quite good so far. The idea is to keep an array of the items in the Tree View that says if the item is disabled or not. When you disable an item you can grey it out by setting a grey color. If you click on a disabled item, you set the selection to the current (or the last) enable item and skip the action of the disabled item. I'll work more on it tomorrow. But you could start by your own so we could compare our results “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
musicstashall Posted December 18, 2018 Author Posted December 18, 2018 I have already made an imitation myself. I thought maybe there is another solution.
musicstashall Posted December 18, 2018 Author Posted December 18, 2018 There is even such a topic: But sorry, this is rude and not for every occasion possible.
Nine Posted December 18, 2018 Posted December 18, 2018 (edited) Ya seen it also. Didn't find it appropriate to all situation either. Just curious, how did you manage to simulate it ? Would you show a basic script of yours ? In any case, good scripting ! ps. also curious about when/how you need to disable item. Are you doing it only programmaticaly under some situations ? Edited December 18, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
musicstashall Posted December 24, 2018 Author Posted December 24, 2018 I did it primitively. If the checkbox is conditionally disable, then when the user tries set checked it, the program removes the check, and so on.
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