|
-
May 23rd, 2005, 11:00 AM
#1
Thread Starter
New Member
How to pass an argument from one Window Form to another?
Hi,
I'm trying to pass an argument from one window form to another ... but could not do it!!! Have try declaring the variable Public and Shared to no avail. Help!!!
What I am doing is to obtain an id from Form A --- (Click a button on Form A to open Form B) --- passing the argument to Form B so the Load event can look up data base on that id.
Thanks
-
May 23rd, 2005, 12:39 PM
#2
Re: How to pass an argument from one Window Form to another?
Create properties on your forms
Kind Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
May 24th, 2005, 12:46 AM
#3
Re: How to pass an argument from one Window Form to another?
If Form A or other objects need to be able to see this value then it should be a public property of Form B, which you can set from Form A. If no other objects need to see the value then you should create a constructor for Form B that takes this value as an argument. If Form B always requires this argument then it can be the only public constructor. In this situation, I usually make the default constructor (found near the top of the auto-generated code) private and then call it from any other constructors I create. You can, of course, create a constructor and public property.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|