Wrox Programmer Forums
|
BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8
This is the forum to discuss the Wrox book Wrox's Visual Basic 2005 Express Edition Starter Kit by Andrew Parsons; ISBN: 9780764595738
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2008, 09:16 AM
Registered User
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chp. 5 help on pg 77

I am a 100% new beginner to this.

the Try it out on Pg 77, I have typed it in exactly as in the book and it doesn't like the chckCelsiusToFahrenheit after the Result in the If Statement. I've tried declaring the variable, because it says it's not declared, however, when I do that, it says it's also invalid. Any help is appreciated.

Here's the code...


    Private Sub btnconvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnconvert.Click
        Dim result As Decimal
        If chkCelsiusToFahrenheit.CheckState = CheckState.Checked Then
            result = CelsiusToFahrenheit(CType(txtDegrees.Text, Decimal))

        Else

            result = FahrenheitToCelsius(CType(txtDegrees.Text, Decimal))
        End If
        txtDegrees.Text = result.ToString

    End Sub

    Private Function FahrenheitToCelsius(ByVal FDegrees As Decimal) As Decimal
        Dim CDegrees As Double

        CDegrees = (5 / 9) * (FDegrees - 32)
        Return CType(CDegrees, Decimal)
    End Function
End Class





Similar Threads
Thread Thread Starter Forum Replies Last Post
Page 77 - Not sorted alphabetically alexlenner BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 August 22nd, 2007 07:36 AM
Chapter 2 Pg. 75-77 while function joshkosmala BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 28th, 2007 04:27 PM
Chp. 4 pg.97 Custom controls studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 4 October 4th, 2006 03:39 PM





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