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]
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]
Comment