Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 2 - How to Design a Windows Forms Application
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

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

    Table of Contents:
  • How to Design a Windows Forms Application
  • How to create a new project
  • How to design a form
  • How to add controls to a form
  • How to set properties

  • 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


    How to Design a Windows Forms Application - How to create a new project


    (Page 2 of 5 )

    To create a new project, you use the New Project dialog box shown in figure 2-2. This dialog box lets you select the type of project you want to create by choosing one of several templates. To create a Windows Forms application, for example, you select the Windows Forms Application template. Among other things, this template includes references to all of the assemblies that contain the namespaces you’re most likely to use as you develop a Windows application.

    The New Project dialog box also lets you specify the name for the project, and it lets you identify the folder in which it will be stored. By default, projects are stored in the Visual Studio Projects folder under the My Documents folder, but you can change that as shown in the previous figure.

    If you want to change the location that’s shown in the New Project dialog box, you can click the Browse button to select a different location; display the drop-down list to select a location you’ve used recently; or type a path directly. If you specify a path that doesn’t exist, Visual Studio will create the necessary folders for you.

    When you click the OK button, Visual Studio automatically creates a new folder for the project, using the project name you specify. In the dialog box in this figure, for example, InvoiceTotal is the project name and C:\VB 2008 is the location. By default, Visual Studio also creates a new folder for the solution, using the same name as the project. As a result, Visual Studio will create one folder for the solution, and a subfolder for the project.

    If that’s not what you want, though, you can deselect the Create Directory For Solution check box. Then, the solution is given the same name as the project and is stored in the same folder. This makes sense for solutions that contain just one project. Because most of the solutions in this book contain only one project, that’s the way most of the applications for this book are set up.

    Incidentally, the terms folder and directory are used as synonyms throughout this book. With the introduction of Windows 95, Microsoft started referring to directories as folders. But most of the Visual Studio documentation still uses the term directory. That’s why this book uses whichever term seems more appropriate at the time.

    By default, the new projects you create target .NET Framework 3.5 so that you can use the features it provides. If you use any of these features, however, any computer that you want to run the application on must also have .NET Framework 3.5. If that’s not the case, you can change the target framework using the drop-down list in the upper right corner of the New Project dialog box. You can select .NET Framework 2.0, 3.0, or 3.5 from this list. Note that if you set the target framework to 3.0 or 3.5, you can still run the application on a computer that doesn’t have the specified framework as long as the application doesn’t use any features of that framework. However, it’s best to set the target framework appropriately for the computers where the application will run so that you don’t accidentally use a feature that isn’t supported.

    The New Project dialog box

     

    How to create a new Visual Basic project

    1. Use the File->New Project command to open the New Project dialog box.
    2. Choose Visual Basic as the Project Type, and choose the Windows Forms Application template for a Windows Forms application. 
       
    3. Enter a name for the project. Then, enter the location (folder) for the project (and solution). 
       
    4. If you want the solution file and the project file to be stored in the same directory, uncheck the Create Directory for Solution box. 
       
    5. Click the OK button to create the new project.

    Description

    • The project template that you select determines the initial files, assembly references, code, and property settings that are added to the project.
    • If the Create Directory For Solution box is checked, Visual Studio creates one folder for the solution and a subfolder for the project. Otherwise, these files are stored in the same folder. 
       
    • If the Save New Projects When Created option is on as shown in the previous figure, the project is saved right after it’s created. Otherwise, the New Project dialog box asks only that you select a template and enter a name for the project. Then, when you save the project, the Save Project dialog box asks for the other information shown above. 
       
    • If you want to target a version of the .NET Framework other than version 3.5, you can select the version from the drop-down list in the upper right corner of the dialog box.  

    Figure 2-2.   How to create a new 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 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek