SigmundSL Posted June 2, 2015 Share Posted June 2, 2015 Hello first of all, and thanks in advance. The issue is the following.For a work that I have I needed to assign an extremely large amount of GUICtrlCreatePic objects (About 80) and I need to call an specific amount of them to be used; but I didn´t fount a method to to something like the following:Global $imGr1, $imGr2, $imGr3, $imGr4, $imGr5, $imGr6, $imGr7, $imGr8, $imGr9, $imGr10 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr11, $imGr12, $imGr13, $imGr14, $imGr15, $imGr16, $imGr17, $imGr18, $imGr19, $imGr20 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr21, $imGr22, $imGr23, $imGr24, $imGr25, $imGr26, $imGr27, $imGr28, $imGr29, $imGr30 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr31, $imGr32, $imGr33, $imGr34, $imGr35, $imGr36, $imGr37, $imGr38, $imGr39, $imGr40 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr41, $imGr42, $imGr43, $imGr44, $imGr45, $imGr46, $imGr47, $imGr48, $imGr49, $imGr50 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr51, $imGr52, $imGr53, $imGr54, $imGr55, $imGr56, $imGr57, $imGr58, $imGr59, $imGr60 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr61, $imGr62, $imGr63, $imGr64, $imGr65, $imGr66, $imGr67, $imGr68, $imGr69, $imGr70 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr71, $imGr72, $imGr73, $imGr74, $imGr75, $imGr76, $imGr77, $imGr78, $imGr79, $imGr80 = GUICtrlCreatePic(0, 0, 0, 0, 0) Global $imGr81, $imGr82, $imGr83, $imGr84, $imGr85, $imGr86, $imGr87, $imGr88, $imGr89, $imGr80 = GUICtrlCreatePic(0, 0, 0, 0, 0) ; altoGrilla and anchoGrilla are the amount of objects in the 2 axis, alto is for objects in vertical and ancho for horizontal ; The margins and amount of objects had been calculated using a function Func CrearGrilla() Local $posWidth = $marginWidth + $boxSize[0] Local $posHeigh = $marginHeigh + $boxSize[1] For $colocar = 0 To ($altoGrilla * $anchoGrilla) Step 1 ;~ GUICtrlSetPos([IN HERE THERE SHOULD BE THE NAME OF 1 OF THE 80 IMAGE BOXES], $posAncho, $posAlto, 96, 96) Next EndFunc ;==>CrearGrillaBasically I require a way to call specifically one of the already created objects, like " $imGr & [$colocar+1] " or something that allows me to modify the name of the variable that is going to edited. There´s a way to do so? Link to comment Share on other sites More sharing options...
spudw2k Posted June 3, 2015 Share Posted June 3, 2015 You have a couple of options. You can utilize an array to house the Pic controls instead of having a variable for each control. ;Untested Global $arrImGr[90] For $iIdx = 0 to UBound($arrImGr)-1 $arrImGr[$iIdx] = GUICtrlCreatePic(0,0,0) Next Else, you should be able use the Execute() function to reference a control via a literal string Look up Execute() in the Help FIle Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF 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