Passing in Params into ChildFormDialog control


Author
Message
Leonard P.
Leonard P.
StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)
Group: Awaiting Activation
Posts: 65, Visits: 306
Hello,

I have a form with a ChildFormDialog control on it, ChildFormDialog is mapped to another form and BO Translation setup. Everything works great, but I need to be able to pass in some params into the Child Dialog form.

I see that one of the overload methods of .ShowDialog(); takes in a params array. But I can't figure out how to catch them in the Child Form.

Can someone advise here.

Thanks.
Guillermo Vilas
Guillermo Vilas
StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)StrataFrame User (192 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 2.3K
Hello Leonard,

If you send the parameter .ShowDialog("Hello World")

You can catch the parameter in the constructor of your ChildForm like this:







Dim m_sParam As String



Public Sub New (MyParam As String)

m_sParam = MyParam

End Sub







And do what ever logic you need.

If you are using SF ListView automation this won´t work since there´s no way to send parameters to childform from it.



Regards

Guillermo


------------------------------------------------------------------------
I would like to change the world, but they don´t give me the source code.
MS Windows 7 Ultimate 64-Bit
Intel(R) Core(TM)2 Quad CPU Q9300 2.50 GHz
6.00 GB of RAM, NVIDIA GeForce 9800 GT

MacBook Pro i5 OSX Lion
Michael Reese
Michael Reese
StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)
Group: StrataFrame Users
Posts: 235, Visits: 1.6K
Hey Leonard

In your main form when you call the child form set up a parameter to pass.

Private Sub AddRecordCode()

Dim LocSiteID As Integer

LocSiteID = Whatever

Call BO.Edit

 If Me.Childform.ShowDialog(LocSiteID) = Windows.Forms.DialogResult.OK Then
                '-- Refresh the Grid
Else

End Sub

-----------------------------------------------------------
Your Childform can get the parameter 


Pass the parameter through the form

Public Sub New(ByVal LocSiteID As Integer)

Your Param = LocSiteID

End Class


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
All good suggestions.  It is just a matter of defining the parameters on your child form just as though you would be calling it directly.  Once this has been done, just provide all of the parameters in the ChildForm.ShowDialog in the order in which the constructor is expecting them.  That is basically it.  Let me know if you don't make any progress.
Leonard P.
Leonard P.
StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)
Group: Awaiting Activation
Posts: 65, Visits: 306
Yeah it worked. Thanks everyone.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search