Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 24th, 2004, 11:27 AM
Registered User
 
Join Date: Sep 2004
Location: Huntington Beach, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Where did I go wrong???

I have tried to find when my errror of "cannot convert type 'double' to systemevent.args! Can anyone show me the light??

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents btncalculate As System.Windows.Forms.Button
    Friend WithEvents txtMortgageAmount As System.Windows.Forms.TextBox
    Friend WithEvents txtMortgageTerm As System.Windows.Forms.TextBox
    Friend WithEvents txtInterestRate As System.Windows.Forms.TextBox
    Friend WithEvents txtmortgagepayment As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.txtMortgageAmount = New System.Windows.Forms.TextBox
        Me.txtMortgageTerm = New System.Windows.Forms.TextBox
        Me.txtInterestRate = New System.Windows.Forms.TextBox
        Me.txtmortgagepayment = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.btncalculate = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'txtMortgageAmount
        '
        Me.txtMortgageAmount.CausesValidation = False
        Me.txtMortgageAmount.Location = New System.Drawing.Point(256, 56)
        Me.txtMortgageAmount.MaxLength = 20
        Me.txtMortgageAmount.Multiline = True
        Me.txtMortgageAmount.Name = "txtMortgageAmount"
        Me.txtMortgageAmount.Size = New System.Drawing.Size(208, 24)
        Me.txtMortgageAmount.TabIndex = 2
        Me.txtMortgageAmount.Text = "Amount"
        '
        'txtMortgageTerm
        '
        Me.txtMortgageTerm.Location = New System.Drawing.Point(256, 120)
        Me.txtMortgageTerm.MaxLength = 4
        Me.txtMortgageTerm.Name = "txtMortgageTerm"
        Me.txtMortgageTerm.Size = New System.Drawing.Size(208, 20)
        Me.txtMortgageTerm.TabIndex = 4
        Me.txtMortgageTerm.Text = "Term"
        '
        'txtInterestRate
        '
        Me.txtInterestRate.Location = New System.Drawing.Point(256, 184)
        Me.txtInterestRate.Name = "txtInterestRate"
        Me.txtInterestRate.Size = New System.Drawing.Size(208, 20)
        Me.txtInterestRate.TabIndex = 6
        Me.txtInterestRate.Text = "Rate"
        '
        'txtmortgagepayment
        '
        Me.txtmortgagepayment.Location = New System.Drawing.Point(280, 304)
        Me.txtmortgagepayment.Name = "txtmortgagepayment"
        Me.txtmortgagepayment.Size = New System.Drawing.Size(152, 20)
        Me.txtmortgagepayment.TabIndex = 8
        Me.txtmortgagepayment.Text = "Result"
        Me.txtmortgagepayment.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(32, 48)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(208, 40)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Enter Amount of Mortage"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label3.Location = New System.Drawing.Point(32, 112)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(208, 40)
        Me.Label3.TabIndex = 3
        Me.Label3.Text = "Enter Term of Mortage in Months"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label4.Location = New System.Drawing.Point(32, 176)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(208, 40)
        Me.Label4.TabIndex = 5
        Me.Label4.Text = "Enter Intrest Rate as Whole Number"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'btncalculate
        '
        Me.btncalculate.Location = New System.Drawing.Point(256, 248)
        Me.btncalculate.Name = "btncalculate"
        Me.btncalculate.Size = New System.Drawing.Size(200, 23)
        Me.btncalculate.TabIndex = 9
        Me.btncalculate.Text = "Calculate!"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(744, 382)
        Me.Controls.Add(Me.btncalculate)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.txtmortgagepayment)
        Me.Controls.Add(Me.txtInterestRate)
        Me.Controls.Add(Me.txtMortgageTerm)
        Me.Controls.Add(Me.txtMortgageAmount)
        Me.Name = "Form1"
        Me.Text = "Mortage Calculator"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'This form will allow a user to calculate the mortage payment amount based upon user input.
        'Created by Abdel Chehade II
        'Release Version 1.03
        'Revision date 9/24/04

    End Sub
    Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtmortgagepayment.TextChanged

        'This calculates the mortgage
        'Using the formula
        'Principal*MonthInt/ (1-(1/(1+MonthInt))^(Years*12))

    End Sub
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMortgageAmount.TextChanged

    End Sub

    Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtInterestRate.TextChanged

    End Sub

    Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click


        Dim Years As Double, Payment As Double
        Dim MonthInt As Double, Amount As Double
        Dim Percent As Double, Principal As Double
        Dim Numerator As Double, Denominator As Double


        'Get Info from user

        Years = Val(txtMortgageTerm.Text)
        Principal = Val(txtMortgageAmount.Text)
        Percent = Val(txtInterestRate.Text) / 100
        MonthInt = Percent / 12

        Numerator = Principal * MonthInt
        Denominator = 1 - (1 / (1 + MonthInt)) ^ (Years * 12)
        Payment = Numerator / Denominator
        txtmortgagepayment.Text = Str(Payment)


        OnClick(Principal * MonthInt / (1 - (1 / (1 + MonthInt)) ^ (Years * 12)))




    End Sub

    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click

    End Sub
End Class
Reply With Quote
  #2 (permalink)  
Old September 25th, 2004, 10:08 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Perhaps you've already tried this, but I would suggest stepping through the code one line at a time. You should then be able to narrow down where in your code the error occurs.

If you still can't figure out what's causing the problem then, post just the segment of code where the error occurs and highlight the line where it happens so it's not necessary to wade through unrealted code.
Reply With Quote
The Following User Says Thank You to Ron Howerton For This Useful Post:
tommykehoe (December 1st, 2013)
  #3 (permalink)  
Old September 28th, 2004, 05:08 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Default

It would be helpful to know where the error occurs. When you want to run your program press F5 this will start the program with debugging. When the error occurs click break. The line of code that caused the error will be hilighted.
Reply With Quote
The Following User Says Thank You to snowy0 For This Useful Post:
tommykehoe (December 1st, 2013)
  #4 (permalink)  
Old September 28th, 2004, 08:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Quote:
quote:Originally posted by ahc2inc

        OnClick(Principal * MonthInt / (1 - (1 / (1 + MonthInt)) ^ (Years * 12)))
This is the line giving you that error. Why do you have this in there?

J
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
Help..What am I doing wrong... Brettvan1 VB.NET 2002/2003 Basics 2 October 18th, 2004 02:36 AM
what's wrong with this? gilgalbiblewheel Classic ASP Databases 2 August 17th, 2004 07:22 PM
What's wrong?Help! amu BOOK: Beginning ASP.NET 1.0 1 October 28th, 2003 08:21 PM



All times are GMT -4. The time now is 05:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.