$formFields = @("UserSurname","UserFirstName")
foreach ( $field in $formFields ) {
$($field+"Label") = New-Object system.Windows.Forms.Label
$($field+"Label").Width = 25
}
I’m trying to initialize a bunch of form items from a string of components. I just don’t understand how to initialize a variable from another value in a loop. I have tried many things but I think this code best illustrates what I am trying to do.
Just can’t seem to construct the right values in the loop
New contributor