I am writing a Windows Forms application in C# using VS.NET 2003 for Pocket PC 2002, and I am new to it. The current plan is to have an initial 'Welcome' screen where the user enters a userID and clicks a button to submit and continue. The next page is a sort of 'Main Menu' from which three different logical paths (Scan, View, and Upload) branch out. The user can be expected to go backwards within these paths to return to the Main Menu (but not the Welcome screen), and at some point, I will be loading a database into the program from the device. My question is about good programming practice regarding when to instantiate the objects for the various forms and how to transmit the data between them.
Here's what the button click event looks like from the Welcome page:
private void WelcomeButton_Click_1(object sender, System.EventArgs e)
MainMenuForm mainMenu = new MainMenuForm(WelcomeTextBox.Text);
--where WelcomeTextBox is where the user enters his or her userID and the MainMenuForm constructor argument is used to set the MainMenuForm private variable userID.
The best idea I have right now is to have MainMenu instantiate the objects for the Scan, View, and Upload pages as private variables and have those objects instantiate the further pages along their logical paths. Is this the ideal way of designing the program? Furthermore, when should I load the database and how does it transmit data to the different forms as the user moves along the program?
Any advice, pointers, links, etc. will be appreciated.