Results 1 to 4 of 4

Thread: Help Coding Visual Basic 2010

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    3

    Question Help Coding Visual Basic 2010

    Hi guys and gals,

    I am new to this forum and new to Visual Basic. I am currently taking a online class introduction to Visual Basic. The class im in is using Visual Basic 2010, I am having problems coding a button to add up 3 textboxes and placing the sum in my toalprice label. Basicly I have a "CalculatePriceButton" when clicked it should put a value in my "Totalpricelabel" of the thee textboxes. Any helpwould be appriciated thnx.. Here is the code I alread have.

    ublic Class MainForum1

    Private Property FontStyle1 As Drawing.Font

    Private Property Italicfont As Drawing.Font

    Private Property donutLabel1 As Object

    Private Property baglesLabel1 As Integer

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

    End Sub

    Private Sub ExitButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton1.Click
    Me.Close()

    End Sub

    Private Sub ColorButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorButton.Click
    TotalPriceLabel2.BackColor = Color.Cyan

    End Sub

    Private Sub FontButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontButton1.Click
    BagelsLabel1.Font = Italic.font
    BagelsTextBox1.Font = Italic.font
    DonutsLabel1.Font = Italic.font
    DonutsTextBox2.Font = Italic.font
    CoffeeLabel1.Font = Italic.font
    CoffeeTextBox3.Font = Italic.font
    ExitButton1.Font = Italic.font
    Price1.Font = Italic.font
    Price2.Font = Italic.font
    CalcpriceButton.Font = Italic.font
    TotalPriceLabel2.Font = Italic.font
    ColorButton.Font = Italic.font
    FontButton1.Font = Italic.font

    End Sub

    Private Sub TotalPriceLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TotalPriceLabel2.Click

    End Sub

    Private Sub BagelsTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagelsTextBox1.TextChanged

    End Sub

    Private Sub BagelsLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BagelsLabel1.Click

    End Sub

    Private Sub CalcpriceButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcpriceButton.Click
    End Sub

    End Class

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,655

    Re: Help Coding Visual Basic 2010

    well, I hate to point out the obvious but the problem seems to be that there's no code in the click event of your CalpriceButton.

    two hints:
    1) even though they maybe numbers, the text in a text box is still a string, so be careful about using their contents directly... you may not have numerical values
    2) Big hint: decimal.tryparse


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  3. #3
    New Member
    Join Date
    Aug 12
    Posts
    3

    Re: Help Coding Visual Basic 2010

    Sorry I should of been more clear in my original post. The reason there is no code it that I dont even know where to begin with coding the event for the calcprice button. I should of also clarified that I am the only student in this class and am having a hard time with the instructor getting back with me. The book I have doesnt mention "strings" or how to enter them.

  4. #4
    New Member
    Join Date
    Aug 12
    Posts
    3

    Re: Help Coding Visual Basic 2010

    Thank you, Ill see if I can put your hints to work :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •