View Single Post
  #7 (permalink)  
Old June 2nd, 2013, 10:47 AM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

When you create the project, by default Visual Studio defines Form1 (the cookie cutter). It actually doesn't make a Form1 yet.

It also defines that piece of code that creates an instance of Form1 (the cookie) and displays it. If you run the program, that form is displayed.

Then you define another type of form (cookie curter), Form2.

Now you have two cookie cutters but there's no code that creates an instance of Form2 and no code to display it. If you want to see an instance of Form2, you need to write your own code because Visual Studio doesn't do that for you.

(Why? Well if you make a project you're going to need to display something or the user won't see anything. So Visual Studio displays Form1 by default. But if you create your own form, Form2, Visual Studio has no idea what you want to do with it. You might want to display it right away or you might want to display it as a dialog only under special circumstances. So it doesn't automatically display that one.)
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)