Sign in to follow this  
Followers 0
alan lim

Dynamic Check Box

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0