Feb. 21, 2011, 4:14 a.m.
posted by seele
Changing the Name of a Form
The first thing you should do when you create a new object is give it a descriptive name, so that's the first thing I'll talk about in this hour. Start by opening the Picture Viewer project you completed in Hour 4, "Understanding Events." If you don't have this project, you can download it from my website.
Your Picture Viewer currently has some useful functionality, but it's not very flexible. In this hour, you'll start building an Options dialog box for the program. Add a new form for the dialog box by following these steps:
You can change the name of a form using the (Name) property in the Properties window at any time, and doing so changes the name property of the form, (but not the name of the file on the hard disk). Whenever possible, give your forms solid names when you first create them.
By the Way
I'm a big fan of using three character naming prefixes, such as frm for form. I find it makes complicated code much more readable when objects have prefixes. I discuss naming conventions in Hour 11, "Using Constants, Data Types, Variables, and Arrays."