Link to home
Start Free TrialLog in
Avatar of gmahler5th
gmahler5thFlag for United States of America

asked on

Getting started with VB.net

I am trying to teach myself VB.net, and I thought I would try to create a mortgage calculator.  How would I get started in VB.net using VisualStudio.net to create a mortgate calculator that has the functionality as shown in this image.

http://www.stevetout.com/calculator.gif
Avatar of AmanBrar
AmanBrar

Hi,

First you would need to design the application by placing four textboxes and using Properties window set their Names as:
txtPrincipal  for Principal Balance
txtRate        for Interest Rate
txtYears      for Number of years
txtAmount   for Payment Amount

and a Button:
btnCalculate   for Calculating

then in the .vb file you need to add the following calculation code:

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        txtAmount.Text = txtPrincipal.Text + (CDbl(txtPrincipal.Text) * CDbl(txtRate.Text) * CDbl(txtYears.Text)) / 100.0
End Sub

hope this helps.
Avatar of gmahler5th

ASKER

I've added all of the textboxes and a button.  This is the code in the form on the code view.  I'm not sure I understand what's going on, where to declare my variables.

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub
End Class
ASKER CERTIFIED SOLUTION
Avatar of AmanBrar
AmanBrar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
gmahler5th ...
You didnt paste the whole code
all your designer code is present in
"Windows Form Designer generated code" region. See the soruce code and click the + sign to expand and see teh code in it
Avatar of Howard Cantrell
Hi,

Here is where I found good examples for getting started in VB.Net

.....http://msdn.microsoft.com/vbasic/downloads/samples/101samples.aspx

Link for ASP programs...

http://msdn.microsoft.com/asp.net/downloads/kits/default.aspx 
I just used tried your code and I got some debug errors.  They are visible in this image:

http://www.stevetout.com/debug-error.jpg

Any thoughts on how I could fix these errors?