cppman Posted March 27, 2006 Share Posted March 27, 2006 (edited) Okay here we go again.. Func Surface_Create($BackgroundColor) $SurfaceGUI = GUICreate("SurfaceGUI", 700, 700) Global $SurfaceColor = $BackgroundColor Return GUICtrlCreateGraphic(0, 0, 700, 700) EndFunc Im Trying to Return GUICtrlCreateGraphic(0, 0, 700, 700) and set the Background Color of it to $Background Color. How would i do this WITHIN the function, while still ONLY returning the CONTROL ID?? nvm again.. i got it: Func Surface_Create($BackgroundColor) $SurfaceGUI = GUICreate("SurfaceGUI", 700, 700) Global $SurfaceColor = $BackgroundColor Dim $Array[2] $Array[0] = GUICtrlCreateGraphic(0, 0, 700, 700) $Array[1] = GUICtrlSetBkColor(-1, $BackgroundColor) Return $Array[0] EndFunc Edited March 27, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
greenmachine Posted March 27, 2006 Share Posted March 27, 2006 Store it as a var, change the background color, and then return the var. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted March 27, 2006 Share Posted March 27, 2006 i'd try it without the return (the id should be the next 1 availible) just a guess - no proof of truth my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
greenmachine Posted March 27, 2006 Share Posted March 27, 2006 Well I suppose you could do it that way, but you could also just have made them global vars at the top of your script and then modify them inside the func. 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