MistakenSanity Posted February 7, 2011 Share Posted February 7, 2011 I did some searching on the forums and didn't see an answer to this. I have also messed with examples from AutoIt, but i couldnt get it working. The script below has many checkboxes and I want to add a lot more. The problem is that I run out of room in the GUI. I know I can expand the GUI window, but I want to keep it the same size and just add a scroll bar to scroll through the check boxes. Can anyone assist me or point me in a good direction? expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "EndScript") #Region ### START Koda GUI section ### Form=D:\Frank's Documents\Auto-It Scripts Archive\Scripts in Devlopment\Form1.kxf $Form1 = GUICreate("GUI WITH SCROLLBARS", 327, 370, 193, 125) $Chk_1 = GUICtrlCreateCheckbox("1", 25, 10, 200, 15) $Chk_2 = GUICtrlCreateCheckbox("2", 25, 30, 200, 15) $Chk_3 = GUICtrlCreateCheckbox("3", 25, 50, 200, 15) $Chk_4 = GUICtrlCreateCheckbox("4", 25, 70, 200, 15) $Chk_5 = GUICtrlCreateCheckbox("5", 25, 90, 200, 15) $Chk_6 = GUICtrlCreateCheckbox("6", 25, 110, 200, 15) $Chk_7 = GUICtrlCreateCheckbox("7", 25, 130, 200, 15) $Chk_8 = GUICtrlCreateCheckbox("8", 25, 150, 200, 15) $Chk_9 = GUICtrlCreateCheckbox("9", 25, 170, 200, 15) $Chk_10 = GUICtrlCreateCheckbox("10", 25, 190, 200, 15) $Chk_11 = GUICtrlCreateCheckbox("11", 25, 210, 200, 15) $Chk_12 = GUICtrlCreateCheckbox("12", 25, 230, 200, 15) $Chk_13 = GUICtrlCreateCheckbox("13", 25, 250, 200, 15) $btnok = GUICtrlCreateButton("OK", 1, 340, 75, 25) GUISetState(@SW_SHOW) $Checked_State = False #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE EndSwitch $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func EndScript() Exit EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 7, 2011 Moderators Share Posted February 7, 2011 MistakenSanity,Welcome to the AutoIt forum. Take a look at the ScrollBars UDF in my sig - you can do what you want with just 1 line of code. 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...
MistakenSanity Posted February 7, 2011 Author Share Posted February 7, 2011 MistakenSanity,Welcome to the AutoIt forum. Take a look at the ScrollBars UDF in my sig - you can do what you want with just 1 line of code. M23It appears I am really doing something wrong. I downloaded the zip file and put "GUIScrollbars_EX.au3" and "GUIScrollbars_Size.au3" into the "Include" folder in AutoIt's program folder. After I do that I tried to run your "GUIScrollbars_Ex_Example_1.au3 and get an error stating "Scrollbar generation failed" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 7, 2011 Moderators Share Posted February 7, 2011 (edited) MistakenSanity,Try putting GUIScrollbars_Ex.au3 and GUIScrollbars_Size.au3 into the same folder as the examples and try then. They do work, honest - I have just downloaded the zip file and tried for myself! M23Edit:Your script works for me like this:expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIScrollBars_Ex.au3> HotKeySet("{ESC}", "EndScript") Global $aChk[50] #Region ### START Koda GUI section ### Form=D:\Frank's Documents\Auto-It Scripts Archive\Scripts in Devlopment\Form1.kxf $Form1 = GUICreate("GUI WITH SCROLLBARS", 327, 370, 193, 125) For $i = 0 To 49 $aChk[$i] = GUICtrlCreateCheckbox("1", 25, 10 + ($i * 20), 200, 15) Next $btnok = GUICtrlCreateButton("OK", 1, 10 + ($i * 20), 75, 25) GUISetState(@SW_SHOW) $Checked_State = False #EndRegion ### END Koda GUI section ### _GUIScrollbars_Generate($Form1, 0, 45 + ($i * 20)) ; This is all you need, honest!!!!! While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func EndScript() Exit EndFuncI hope it does for you too. Edited February 7, 2011 by Melba23 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...
MistakenSanity Posted February 7, 2011 Author Share Posted February 7, 2011 Everything is working perfectly now thanks! Turns out the problem was the network I was on. My work network must have kept corrupting the download because I came home and downloaded it and it worked perfectly. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2011 Moderators Share Posted February 8, 2011 MistakenSanity,it worked perfectlyGood. Do come back if you need any help integrating the UDF into your script. 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