Mic Posted January 11, 2014 Share Posted January 11, 2014 GUICtrlSetState( $cbTrks, $GUI_CHECKED) works. If I only have the string "$cbTrks" how can I get the reference needed? tia. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 11, 2014 Moderators Share Posted January 11, 2014 Mic,You have the answer in the title, so why the question? 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...
Mic Posted January 11, 2014 Author Share Posted January 11, 2014 Mic, You have the answer in the title, so why the question? M23 ah sorry that does not work - was just using it as an example of one of the things I had tried and asking for the correct of doing it. Link to comment Share on other sites More sharing options...
l3ill Posted January 11, 2014 Share Posted January 11, 2014 Hi Mic, thats pretty vague dude..... Reference to what? The variable ? or the the string that is represented by the variable? Show some more code or a reproducer of the issue and you will get better answers Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted January 11, 2014 Moderators Solution Share Posted January 11, 2014 Mic, ah sorry that does not workSmall spherical objects! #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cCheck_1 = GUICtrlCreateCheckbox("Test 1", 10, 10, 80, 30) $cCheck_2 = GUICtrlCreateCheckbox("Test 2", 10, 90, 80, 30) GUICtrlSetState($cCheck_1, $GUI_CHECKED) GUICtrlSetState(Eval("cCheck_2"), $GUI_CHECKED) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndYou might have been doing it wrong, but Eval definitely works. 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...
Mic Posted January 11, 2014 Author Share Posted January 11, 2014 Thanks so much for the example ... yes it does work when you know what you are doing :-) #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cCheck_1 = GUICtrlCreateCheckbox("Test 1", 10, 10, 80, 30) $cCheck_2 = GUICtrlCreateCheckbox("Test 2", 10, 90, 80, 30) $cCheck_3 = GUICtrlCreateCheckbox("Test 3", 10, 180, 80, 30) GUICtrlSetState($cCheck_1, $GUI_CHECKED) GUICtrlSetState(Eval("cCheck_2"), $GUI_CHECKED) $strngVar = "cCheck_3"; works when you know what you are doing $strngVar = "$cCheck_3"; does not work when you are me :-) GUICtrlSetState(Eval($strngVar), $GUI_CHECKED) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 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