Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Could someone please explain to me how i can pass a parameter to a from being called? I know how to do it with functions easily enough, i know i could just create a public variable - but i would like to pass the parameter directly to the form to make it a lot less messy.

 

Thanks.

Posted

You don't have to use a string array, that's just an example, you could use whatever you like... to execute:

newForm = new myForm(myParameter)

 

Other forms class code:

C#:

public class myForm

{

myForm(string [] args)

{

 

}

}

VB:

Public Class myForm

Sub New(args() As String)

 

End Sub 'New

End Class 'myForm

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...