zeffy 0 Posted May 9, 2010 Can someone explain how to set variables with a Combo box? For example I have $Combo2 = GUICtrlCreateCombo("", 12, 48, 117, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "640×480|800×600|1024×768|1152×864|1280×768|1280×960|1280×1024|1600×1200") And I want it to set two variables when the user choses a resolution, so if they chose 1024×768, it would set $x to 1024, and $y to 768. Anyone got any ideas? Thanks Share this post Link to post Share on other sites
Yoriz 6 Posted May 9, 2010 Here is an example #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 249, 115, 211, 125) $Combo_Screensize = GUICtrlCreateCombo("", 16, 24, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "640×480|800×600|1024×768|1152×864|1280×768|1280×960|1280×1024|1600×1200") $hLabelX = GUICtrlCreateLabel("X = ", 16, 56, 150, 17) $hLabelY = GUICtrlCreateLabel("Y = ", 16, 80, 150, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo_Screensize $sReadCombo = GUICtrlRead($Combo_Screensize) $aSplit = StringSplit($sReadCombo,"×") $iX = $aSplit[1] $iY = $aSplit[2] GUICtrlSetData($hLabelX, "X = " & $iX) GUICtrlSetData($hLabelY, "Y = " & $iY) EndSwitch WEnd 1 galan2015 reacted to this GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Share this post Link to post Share on other sites
zeffy 0 Posted May 9, 2010 Here is an example #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 249, 115, 211, 125) $Combo_Screensize = GUICtrlCreateCombo("", 16, 24, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "640×480|800×600|1024×768|1152×864|1280×768|1280×960|1280×1024|1600×1200") $hLabelX = GUICtrlCreateLabel("X = ", 16, 56, 150, 17) $hLabelY = GUICtrlCreateLabel("Y = ", 16, 80, 150, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo_Screensize $sReadCombo = GUICtrlRead($Combo_Screensize) $aSplit = StringSplit($sReadCombo,"×") $iX = $aSplit[1] $iY = $aSplit[2] GUICtrlSetData($hLabelX, "X = " & $iX) GUICtrlSetData($hLabelY, "Y = " & $iY) EndSwitch WEnd Thank you Share this post Link to post Share on other sites