Started to do some debugging and one thing that is wrong is that you are test the handle "Switch $Combo1"in stead of "Switch $Choice". Here is how you can do debugging in SciTE (Full version) with Al+D: #include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 285, 192, 114)
$Button1 = GUICtrlCreateButton("Randomize Button", 192, 184, 185, 73)
$Input1 = GUICtrlCreateInput("0", 24, 40, 121, 21)
$Input2 = GUICtrlCreateInput("0", 24, 72, 121, 21)
$Combo1 = GUICtrlCreateCombo("", 24, 112, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData($Combo1, "1|2|3|4|5")
$Input3 = GUICtrlCreateInput("0", 400, 40, 121, 21)
$Input4 = GUICtrlCreateInput("0", 400, 72, 121, 21)
$Combo2 = GUICtrlCreateCombo("", 400, 112, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData($Combo2, "A|B|C|D|E")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $Max = 0
Global $Max1 = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Combo1
Global $Choice = GUICtrlRead($Combo1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Choice = ' & $Choice & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
Switch $Choice
Case "1"
$Max=10
Case "2"
$Max=20
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Max = ' & $Max & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
Case "3"
$Max=30
Case "4"
GUICtrlSetData($Max, 40)
Case "5"
GUICtrlSetData($Max, 50)
EndSwitch
Case $Combo2
Global $Max1 = GUICtrlRead($Combo2)
Switch $Max1
Case "A" Or "B" Or "C"
GUICtrlSetData($Max1, 60)
Case Else
GUICtrlSetData($Max1, 100)
EndSwitch
Case $Button1
Randomize()
EndSwitch
WEnd
Func Randomize()
$Input1 = Random(0, $Max, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Input1 = ' & $Input1 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
$Input2 = Random(0, $Max, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Input2 = ' & $Input2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
$Input3 = Random(0, $Max1, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Input3 = ' & $Input3 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
$Input4 = Random(0, $Max1, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Input4 = ' & $Input4 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
EndFunc ;==>RandomizeJust to get you going. Jos