Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - Adding Features to a Windows Forms Applica...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Adding Features to a Windows Forms Application
By: Murach Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating:  stars stars stars stars stars / 0
    2009-07-07

    Table of Contents:
  • Adding Features to a Windows Forms Application
  • How to add navigation features
  • The property settings for the Invoice Total form
  • How to name and save the files of a project
  • Perspective

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Adding Features to a Windows Forms Application - How to name and save the files of a project


    (Page 4 of 5 )

    When you’re working on a project, you may want to change the names of some of the files from their defaults. Then, you’ll want to save the files with their new names.

    How to name the files of a project

    You may have noticed throughout this chapter that I didn’t change the default name of the form (Form1.vb) that was added to the Invoice Total project when the project was created. In practice, though, you usually change the name of this form so it’s more descriptive. For example, figure 2-9 shows how to use the Solution Explorer to change the name of the form file to frmInvoiceTotal.vb. When you do that, Visual Studio will also change the Name property for the form from Form1 to frmInvoiceTotal and modify any of the code that’s been generated for the form accordingly.

    You may also want to change the name of the project. Or, you may want to change the name of the solution so it’s different from the project name. If so, you can use the technique presented in this figure to do that too.

    How to save the files of a project

    Figure 2-9 also describes how to save the files of a project. Because Visual Studio saves any changes you make to the files in a project when you build the project, you won’t usually need to save them explicitly. However, it’s easy to do if you need to.

    Notice in this figure that two factors determine which files are saved: what’s selected in the Solution Explorer and the command you use to perform the save operation. If, for example, a single file is selected, you can use the Save command to save just that file, and you can use the Save All command to save the file along with the project and solution that contain the file. In contrast, if a project is selected in the Solution Explorer, the Save command causes the entire project to be saved, and the Save All command causes the entire solution to be saved.

    If you haven’t saved all of your recent changes when you close a project, Visual Studio will ask whether you want to save them. As a result, you don’t need to worry that your changes will be lost.

    The Solution Explorer as a form file is being renamed

     

    How to rename a file, project, or solution

    1. You can rename a file, project, or solution by right-clicking on it in the Solution Explorer window and selecting the Rename command from the shortcut menu. Or, you can select the file, project, or solution in the Solution Explorer and then press F2. Then, you can enter the new name for the file, project, or solution.
    2. Be sure not to change or omit the file extension when you rename a file. Remember too that using a three-letter prefix to indicate the contents of the file (like frm for a form file) makes it easier to tell what each file represents. 
       
    3. When you change the name of a form file, Visual Studio will also change the Name property for the form and update any references within the existing code for the form, which is usually what you want.

     How to save a file, project, or solution

    • You can use the Save All button in the Standard toolbar or the Save All command in the File menu to save all files and projects in the solution.
    • You can use the Save button in the Standard toolbar or the Save command in the File menu to save a file, project, or solution. The files that are saved depend on what’s selected in the Solution Explorer window. If a single file is selected, just that file is saved. If a project is selected, the entire project and its solution are saved. And if a solution is selected, the entire solution and all its projects are saved. 
       
    • If you try to close a solution that contains modified files, a dialog box is displayed that asks you if you want to save those files.  

     

    Figure 2-9.  How to name and save the files of a project

    More Visual Basic.NET Articles
    More By Murach Publishing


     

    Buy this book now. This article is excerpted from chapter two of Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456). Check it out today at your favorite bookstore. Buy this book now.

    VISUAL BASIC.NET ARTICLES

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek