Page 1 of 1

multiform passing data to called form

Posted: Tue Jun 19, 2012 4:10 am
by mysapien@upgreat.ch
I've created a multiform project in which records can be added to a listbox by calling a second form to enter the required data.I managed to get the data back from the called form.Now I would need to add editing capabilities to this by populating the controls (simple textboxes) of the called form with values from the listbox, so that the user can edit them.But the variables that i use to get the data back, seem not to have any effect in the reverse.Here's an excerpt of the test-call:$AccountForm_textboxAccountUsername="Some Text"if((Call-AccountForm_pff) -eq "OK"){ Write-Host $AccountForm_textboxAccountUsername}


druf@up-great.ch2012-06-19 11:11:54

multiform passing data to called form

Posted: Tue Jun 19, 2012 4:41 am
by davidc
Those variables only return the result when a sub form is called and can't be used to initialize. If you need to pass parameters add a parameter block to the top of the subform's editor: param ([string]$textvalue) Then initialize the textbox in the Form's load event block. Next you update the subform call as follows: if((Call-AccountForm_pff -textvalue "Some text") -eq "OK"){...}

multiform passing data to called form

Posted: Tue Jun 19, 2012 5:32 am
by mysapien@upgreat.ch
Many thanks.That was exactly what I was looking for.Are there any good sample projects, which show all this concepts of a multiform-project

multiform passing data to called form

Posted: Tue Jun 19, 2012 6:12 am
by davidc
It's on my TODO list :) There are some projects on the blog but they don't use parameter passing between forms. David