alan lim Posted September 17, 2010 Share Posted September 17, 2010 Hi, I would like to create a dynamic check box base on array scanned result. Example, if there are 3 items in array, it will display 3 check boxes. Could it be done. Thank you. Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2010 Share Posted September 17, 2010 Not sure about that, Ive never had any luck myself with dynamic controls. But you could have a shed load off disabled checkboxes, and enable them dynamically. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
alan lim Posted September 17, 2010 Author Share Posted September 17, 2010 Not sure about that, Ive never had any luck myself with dynamic controls.But you could have a shed load off disabled checkboxes, and enable them dynamically.Thank you for your relpy. I am new to AutoIt and quite not understand what do you mean. Could you able to show me some sample script?In fact, I wanted to use Array to scan some files with wildcard command and the result will appear to check box. Therefore, I can select whatever file that i want to delete. Thank you Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2010 Share Posted September 17, 2010 example of disabling/enabling checkbox. #include <Guiconstants.au3> $hgui = GUICreate("GUI") $hchkbx = GUICtrlCreateCheckbox("CHKBX",10,10) $hbtn1 = GUICtrlCreateButton("enable",10,40) $hbtn2 = GUICtrlCreateButton("disable",10,70) GUICtrlSetState($hchkbx,$GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $hbtn1 ; your function name might go here to determine whether to enable the checkbox. GUICtrlSetState($hchkbx,$GUI_ENABLE) Case $hbtn2 GUICtrlSetState($hchkbx,$GUI_DISABLE) EndSwitch WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 17, 2010 Moderators Share Posted September 17, 2010 alan lim, Do not double post in General and GUI forums. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
alan lim Posted September 20, 2010 Author Share Posted September 20, 2010 example of disabling/enabling checkbox. #include <Guiconstants.au3> $hgui = GUICreate("GUI") $hchkbx = GUICtrlCreateCheckbox("CHKBX",10,10) $hbtn1 = GUICtrlCreateButton("enable",10,40) $hbtn2 = GUICtrlCreateButton("disable",10,70) GUICtrlSetState($hchkbx,$GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $hbtn1 ; your function name might go here to determine whether to enable the checkbox. GUICtrlSetState($hchkbx,$GUI_ENABLE) Case $hbtn2 GUICtrlSetState($hchkbx,$GUI_DISABLE) EndSwitch WEnd Hi JohnOne, Thank you for your script. As I mentioned earlier, I would like to have the number of check box appear that depend on the Array record. Let me elaborate what I wanted. Example, I will use array to scan a txt file and the txt file contains 5 row of people names. I want a GUI windows which appear 5 check box of the people name (If Array recorded 4 then it will has 4 check box). Thus, I can select one or more from the check box which I want to remove. I hope you and someone could understand what I mean. It is possible to have such dynamic check box depend on array record. Thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 20, 2010 Moderators Share Posted September 20, 2010 alan lim, Did you look at the answer I posted in your other thread? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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