Changing the Name of a Form

The first thing you should do when you create a new object is to give it a descriptive name, so that's the first thing I'll talk about in this hour. Start Visual C# .NET now (if it's not already running) and create a new Windows Application titled Forms Example. Using the Properties window, change the name of the form to fclsFormsExample. When you need to create a new instance of this form, you'll use this name rather than the default generic name of Form1.

You may have noticed that the tabs in the designer refer to the name of the form file—not the name you give it in code. Change the filename of the form now by right-clicking Form1.cs in the Solutions Explorer, choosing Rename, and then changing the name of the form ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.