Tuesday, December 30, 2014

Passing Parameters?

For the first error you're trying to create a private constructor when a public constructor is already defined. Remove your private constructor as you cannot use it with Winforms anyway.


The second error is the same problem. You already have defined a method called Form1_Load so you cannot define it again.


You can pass parameters to methods you write. However you cannot pass parameters to methods that are defined through other means such as part of event handlers or via interface methods. In those cases you will generally store data within your class rather than passing it around as parameters. If you need to pass data into your class and you cannot use method parameters then use properties to store the values instead. The method can then reference the properties as needed.


Michael Taylor

http://blogs.msmvps.com/p3net


No comments:

Post a Comment