|
-
Aug 22nd, 2012, 10:36 PM
#1
Thread Starter
New Member
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
-
Aug 23rd, 2012, 06:57 AM
#2
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
-
Aug 23rd, 2012, 08:45 AM
#3
Thread Starter
New Member
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.
-
Aug 23rd, 2012, 08:47 AM
#4
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|