It makes no sense at all. There is no such concept as "open
". It's not clear what did you mean by
, it also makes no sense. Also pay attention for
. It cannot even compile.
You need to understand what are types and what are instances of the types, objects. Assuming
are types, and picture boxes are instance members (non-static), only one conclusion can be made: you have no clue on programming, in the most elementary and basic things. Not to worry: with appropriate effort and slow methodical approach, it can be learned without big problems.
There is nothing to fix here, except one thing: stop thinking that you can get to UI. You are not ready yet. Get to the very basics, learn what are types, objects, members, methods, parameters, and so on. For this purpose, exercises with the simplest console-only application is the very it. :-)
See also my article Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows
It is directly related to your question. But try to understand, not just copy the code. Understand what are types and instances. (Sigh…)