Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass parameters to a form?
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00892623
Message ID:
00892685
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>It's all in the message's subject: how can I pass values to a form?
>I have to run a dialog form and I would like to pass some parameters, how can this be done?
>I run the form with something like:
>
>Dim frm As New myform
>frm.ShowDialog()
>
>I have seen sintax like
>
>frm.ShowDialog(theparameter)
>
>but I've not seen the code in the called form, so, can someone help me?
>Thanks
>
>Franco

You can do it this way:

Dim frm As New myform("foo", "bar")
* Form's Constructor
    Public Sub New(ByVal myString1 As String, ByVal myString2 As String)
        MyBase.New()
' do whatever with the received parameters here

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub
Would that work for you?
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform