I am building a dynamic GUI in powershell but having some problems The objects are created based on folders in the current directory
$i = 0
$arrbuttons | %{
$_.add_Click({$arrboxes[$i].Text = "hello"})
$i++
}
All my buttons are located in $arrbuttons array and all my textboxes in the $arrboxes array If i set the $i to 0 and dont addition at the end everything works fine but the text always gets in the first textbox right? But when i addition at the end i get an exception saying that property text cannot be found.
What over all I am trying to achieve is this just a small problem along the way to build a dynamic GUI with buttons textboxes and a stopwatch for each row, but I am not sure on how to dynamically create stopwatches and make the script understand which stopwatch to stop and start when pressed the individual buttons.
Textbox,Start,Stop,Reset
Textbox,Start,Stop,Reset
You get it so when pressing start textbox will say something like "tick tock" and when pressing stop the elapsed time will display in the correct textbox.