I get a list externally and create a load of labels and input fields to match it.
If that list is larger than the gui can handle, the controls are outside the bounds of the gui height.
Wondering what sort of control I can put them in, so user can scroll to see all the fields.
Some sort of scrollable panel would be ace, but open to any suggestions.
Here is reproducer.
AutoIt
#include <Array.au3> Global $AppName = "The App" Global $aProducts = FileReadToArray(@ScriptDir & "\Products.txt") ;_ArrayDisplay($aProducts) _AbsentCategory($aProducts) Func _AbsentCategory(ByRef $array) If UBound($array) < 1 Then Return EndIf $Top = 40 Local $aControls[UBound($array)][4] Local $hNotFoundGUI = GUICreate($AppName & ": Products need adding", 575, 700) ; Labels GUICtrlCreateLabel("Product name", 15, 10, 100) GUICtrlCreateLabel("Category 1", 240, 10, 100) GUICtrlCreateLabel("Category 2", 410, 10, 100) Local $hNotFounButtonOK = GUICtrlCreateButton("Done", 15, 670, 60) ; Create an array of contrils with the backup array as text For $y = 0 To UBound($array) - 1 GUICtrlCreateLabel($array[$y], 15, $Top, 210, 20) $aControls[$y][0] = GUICtrlCreateInput("", 240, $Top, 150) ; cat 1 $aControls[$y][1] = GUICtrlCreateInput("", 410, $Top, 150) ; cat 2 $Top += 30 Next GUISetState() Sleep(5000) While GUIGetMsg() <> $hNotFounButtonOK WEnd ; Not finished yet ; Check all fields are filled before proceding Do Until _Checkfields($aControls) ; Update array For $i = 0 To UBound($array) - 1 $array[$i][1] = GUICtrlRead($aControls[$i][0]) $array[$i][2] = GUICtrlRead($aControls[$i][1]) Next EndFunc ;==>_AbsentCategory Func _Checkfields(ByRef $array) For $i = 0 To UBound($array) - 1 If GUICtrlRead($array[$i][0]) = "" Or GUICtrlRead($array[$i][1]) = "" Then MsgBox(4096 + 48, $AppName & ": - Warning", "Fill all fields" & @CRLF & "and press OK") Return 0 EndIf Next Return 1 EndFunc ;==>_Checkfields
Here is Products.txt
Plain Text
Product1 Product2 Product3 Product4 Product5 Product6 Product7 Product8 Product9 Product10 Product11 Product12 Product13 Product14 Product15 Product16 Product17 Product18 Product19 Product20 Product21 Product22 Product23 Product24 Product25 Product26 Product27 Product28 Product29