Chapter 2. Creating Your First Windows Application

function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); } function Print() { window.focus(); if(window.print) { window.print(); window.setTimeout('window.close();',5000); } }
Team-Fly    

Special Edition Using Microsoft® Visual Basic® .NET
By Brian Siler, Jeff Spotts
Table of Contents
Part I:  Getting Started with Visual Basic .NET


In this chapter

Setting Up a New Windows Project

Designing the User Interface

Coding Your Program's Actions

Running Your Program

From Here…

You have probably read programming books that walk you step-by-step through the process of creating your first program. Typically, you create some form of the classic "Hello, World!" application. In this extremely simple example, the user is asked to initiate some action such as clicking a button or pressing a key, and the computer responds with a message such as "Hello, World!" A slightly more advanced variation asks for the user's name and responds with a customized greeting like "Hello, Lauren!"

Although examples like this might be sufficient for demonstrating that you can indeed use a programming language to create a program, the resulting application isn't very useful. Our approach is to begin with a sample program that not only demonstrates the fundamentals of creating a Visual Basic .NET application, but also can be used in the real world.

In this chapter, you'll create a Windows-based Loan Calculator program that calculates the periodic payment needed to repay a loan, based on various factors such as the loan term and interest rate. Your users will be able to input and modify values for these and other variable factors, perform the calculation, and view the results. In addition, they will be able to view an amortization schedule for the entire life of the loan.

Note

The application you'll be creating was adapted from a shareware program I wrote named "My Amortizer." With proper planning and design, Visual Basic .NET can be used to create commercial-quality software applications.


Before you begin, take a look at what the final product will look like. Figure 2.1 shows the Loan Calculator's main screen as it's being used.

Figure 2.1. The Loan Calculator program offers the user a variety of options.

graphics/02fig01.gif


    Team-Fly    
    Top
     



    Special Edition Using Visual Basic. NET
    Special Edition Using Visual Basic.NET
    ISBN: 078972572X
    EAN: 2147483647
    Year: 2001
    Pages: 198

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net