Jay1b Posted September 24, 2004 Posted September 24, 2004 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. Quote
bri189a Posted September 24, 2004 Posted September 24, 2004 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 Quote
Jay1b Posted September 24, 2004 Author Posted September 24, 2004 I could of swore that is exactly what i tried! Perhaps i missed something. I will try again :) Thanks. Quote
bri189a Posted September 24, 2004 Posted September 24, 2004 If it doesn't work paste your code in the calling form that does the calling and paste you class constructor of the callee form and we'll help you. Quote
Administrators PlausiblyDamp Posted September 24, 2004 Administrators Posted September 24, 2004 Also if you haven't looked at http://www.xtremedotnettalk.com/showthread.php?t=83092 then you may want to have a quick glance. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jay1b Posted September 29, 2004 Author Posted September 29, 2004 Thanks that link worked a treat. Quote
bri189a Posted September 29, 2004 Posted September 29, 2004 I'm curious who got Bucky's 'The Answer is 42' part besides myself :) Quote
Jay1b Posted September 29, 2004 Author Posted September 29, 2004 Me. Just a case of reading it carefully. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.