WilliamWhite Posted May 28, 2013 Share Posted May 28, 2013 Hi Guys, I have the feeling this should be simple.... but then again "i am lost" I create a series of input fields on a gui like: For $i = 0 to $iTabelBreedte For $ii = 0 to $iTabelBreedte $oInvoer [$ii][$i] = GUICtrlCreateInput($aInvoer[$ii][$i], $iTabelxStart + $i*50, $yInvoerblok + $ii *25 , 45, 24) GUICtrlSetFont(-1, 11) Next Next It creates a box of input fields with $iTabelBreedte Rows and $iTabelBreedte columns Now comes the question: Say i generate through a button this table with 10 rows and 10 columns. Then i Hit the button again, but this time i want the the grid to be 5 x 5. The things is that it will leave (offcourse) the old rows and colums aswell. And the 5 x 5 will be drawn over the old ones And i want a fresh table with only the 5 x 5 visible. I don't care about if there was data in the rows and columns that need to dissappear (thats handled in the calculations) But how to clean the input fields before i fill them again? I tried things like: $oInvoer [$ii][$i] = GUICtrlCreateInput("", 0, 0, 0,0) and $oInvoer [$ii][$i] ="" But no go ...(don't laugh at least i tried ) It is all done on a gui. Any suggestions? Couldnt find an answer on the forum aswell, But maybe a use the wrong phrases to search. Thanks A mill!! even for just reading! Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted May 28, 2013 Moderators Solution Share Posted May 28, 2013 WilliamWhite, Does this help: expandcollapse popup#include <GUIConstantsEx.au3> Global $oInvoer $iTabelxStart = 10 $yInvoerblok = 10 $hGUI = GUICreate("Test", 515, 500) ; Picka starting size $iTabelBreedte = Random(2, 10, 1) ; Draw the controls _DrawControls($iTabelBreedte) $cButton = GUICtrlCreateButton("Reload", 10, 450, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton ; Delete the existing controls For $i = 0 To $iTabelBreedte - 1 For $ii = 0 To $iTabelBreedte - 1 GUICtrlDelete($oInvoer[$ii][$i]) Next Next ; Pick a new number and draw them $iTabelBreedte = Random(2, 10, 1) _DrawControls($iTabelBreedte) EndSwitch WEnd Func _DrawControls($iNumber) Global $oInvoer[$iNumber][$iNumber] For $i = 0 To $iNumber - 1 For $ii = 0 To $iNumber - 1 $oInvoer[$ii][$i] = GUICtrlCreateInput($ii + ($i * 10), $iTabelxStart + $i * 50, $yInvoerblok + $ii * 25, 45, 24) GUICtrlSetFont(-1, 11) Next Next EndFunc Please ask if you have any questions. M23 WilliamWhite 1 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...
WilliamWhite Posted May 28, 2013 Author Share Posted May 28, 2013 Wow is it allowed to kiss a moderator? Many thanks, it works like a charm. Looked like an idiot for hiding, never for deleting You are the greatest, or did i mention that allready . regards William Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 28, 2013 Moderators Share Posted May 28, 2013 WilliamWhite. is it allowed to kiss a moderator? My wife might object if you tried - but I will happily just accept the compliment! Glad I could help. M23 WilliamWhite 1 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