Hey guys, I have a program in C# that I am having problems with. I am trying to put all my code into classes, but I've noticed that whenever I try to reference Form1, it does not list the controls, even if they are public. I've tried creating an instance of the form, and that does seem to reveal the form's controls, however when the code executes, nothing happens. Any solutions would be appreciated.
C# Can't Access Forms!?
Make sure that you reference the form object in its scope. You can use the keyword "this" (e.g this.Name) to reference the current object.
If that does not resolve your issue, you may have a corrupt intelliSense or other causes. If you are referencing an object from an other class, note that there will be a difference when using a static member and instance member.
Reply:Your question is too general.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment