Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2012, 07:46 PM
hemihead_dave hemihead_dave is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 8 hemihead_dave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 34 sec
Reputation Power: 0
I Need Help Using tryParse in Visual Basics

Hi, everyone. I am new to this site, just found it. My ? is this. I wrote a code for an assignment I had in my book, but didn't use tryParse. My book uses this method and I am totally lost with it.

Here is the code that I have and it works. I need to convert it using tryParse, any ideas where to start?

Option Strict On
Option Explicit On

Public Class MainForm1

Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles exitButton3.Click Me.Close()
End Sub

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles clearButton.Click
lengthBox.Text = String.Empty
widthBox.Text = String.Empty
squareftBox.Text = String.Empty
areaBox.Text = String.Empty
totalBox.Text = String.Empty
End Sub

Private Sub lengthLabel_Click(sender As System.Object, e As System.EventArgs) Handles lengthLabel.Click
Dim lengthLabel As Double = CDb(Me.lengthBox.Text)
End Sub

Private Sub widthLabel_Click(sender As System.Object, e As System.EventArgs) Handles widthLabel.Click
Dim widthLabel As Double = CDbl(Me.widthBox.Text)
End Sub

Private Sub calculateButton1_Click(sender As System.Object, e As System.EventArgs) Handles calculateButton1.Click
Dim lengthLabel As Double = CDbl(Me.lengthBox.Text)
Dim widthLabel As Double = CDbl(Me.widthBox.Text)
Me.areaBox.Text = Format(lengthLabel * widthLabel, "#,##0.00")
Dim totalprice As Double = CDbl(Me.squareftBox.Text)
Dim areaLabel As Double = CDbl(areaBox.Text)
totalBox.Text = Format(lengthLabel * widthLabel * totalprice, "C2")
End Sub
End Class

Last edited by hemihead_dave : October 24th, 2012 at 08:06 PM. Reason: title correction

Reply With Quote
  #2  
Old October 24th, 2012, 08:52 PM
hemihead_dave hemihead_dave is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 8 hemihead_dave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 34 sec
Reputation Power: 0
I need help using tryParse in Visual Basics

Does anyone know how to use tryParse in Visual Basics?

Reply With Quote
  #3  
Old October 24th, 2012, 10:03 PM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,861 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 5 h 45 m 49 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Did you know that MSDN often has code samples? Like Int32.TryParse's page has one.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Using tryParse in Visual Basic

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap