Visual Basic 2005 Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steci
    New Member
    • Mar 2008
    • 2

    Visual Basic 2005 Question

    I need some help for VB.

    When i press Play, it keeps comes out with Error.
    I know where i got it wrong but don't know what to put it.

    "dPeopleLivingH ouse = CDbl(txtPeopleL ivingHouse8KWH. Text)"

    this bit is wrong. (CDbl)

    can anyone help me ?

    [code=vbnet]
    Public Class frmGreenEarthEn ergy

    Const dPeopleLivingHo use8KWH As Integer = 8

    Private Sub bntExit_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles bntExit.Click

    Me.Close()

    End Sub

    Private Sub bntCalc_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles bntCalc.Click


    Dim dPeopleLivingHo use As Integer
    Dim dPeopleLivingHo use8KWH As Integer
    Dim dHotWater As Boolean
    Dim dPoolFilter As Boolean
    Dim dDeilingInsulat ion As Boolean
    Dim dAirConditionin g As Double
    Dim dElectricHeater As Integer
    Dim dRvVideo As Double
    Dim dDishwasher As Integer
    Dim dFreezer As Boolean
    Dim dRefrigerator As Boolean
    Dim dElectricStovet op As Boolean
    Dim dElectricOven As Boolean
    Dim dComputerPrinte r As Double
    Dim dWashingMachine As Integer
    Dim dDryer As Integer
    Dim dSpa As Double
    Dim dElectricityPla n As String

    dPeopleLivingHo use = CDbl(txtPeopleL ivingHouse8KWH. Text)

    dPeopleLivingHo use = dPeopleLivingHo use * dPeopleLivingHo use8KWH
    lblPeopleLiving House.Text = dPeopleLivingHo use
    End Sub
    End Class[/code]
    Last edited by debasisdas; Apr 8 '08, 04:45 AM. Reason: added code=vbnet tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET forum.

    Comment

    Working...