VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 309,261 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,473 people online right now. Registration is fast and FREE... Join Now!




Basic Calculator help

 

Basic Calculator help

NotaNerd

2 Dec, 2008 - 08:07 AM
Post #1

New D.I.C Head
*

Joined: 2 Dec, 2008
Posts: 1

quite simply i cannot get my calculator "Plus" to work, i have been looking for how to make it work but with no luck so ive turned to u guys for help here is what i have got...
CODE
   Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
      


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = TextBox1.Text + Button1.Text

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = TextBox1.Text + Button2.Text
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TextBox1.Text = TextBox1.Text + Button3.Text
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TextBox1.Text = TextBox1.Text + Button4.Text
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        TextBox1.Text = TextBox1.Text + Button5.Text
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        TextBox1.Text = TextBox1.Text + Button6.Text
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        TextBox1.Text = TextBox1.Text + Button7.Text
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        TextBox1.Text = TextBox1.Text + Button8.Text
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        TextBox1.Text = TextBox1.Text + Button9.Text
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
      
        'Plus Button this bit im stuck on!!!!
        total1 = 0 'initialise total1
        total1 = total1 + Val(TextBox1.Text) 'add text property of text


    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        TextBox1.Text = TextBox1.Text + Button11.Text
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        TextBox1.Text = TextBox1.Text + Button12.Text
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        'Equal button

        total2 = 0 'initiliase total2
        total2 = total2 + total1 + Val(TextBox1.Text) ' add textbox property to total1 and
        TextBox2.Text = Format(total1, "£.##.#") 'display total2

        TextBox1.Text = "" 'empty content of textbox
        TextBox1.Clear() 'clear textbox
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


Thanks if u can help, its just the Plus bit i need help with, if u notice anything else wrong please tell me.

thanks
/Niall

This post has been edited by NotaNerd: 2 Dec, 2008 - 08:09 AM

User is offlineProfile CardPM
+Quote Post


Posts in this topic
NotaNerd   Basic Calculator help   2 Dec, 2008 - 08:07 AM
PsychoCoder   Moved to VB.NET :)   2 Dec, 2008 - 09:41 AM
nofear217   what exactly is it doing? one thing you might wan...   3 Dec, 2008 - 07:03 AM

Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 10:09AM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month