| You are here: DEVPPL ‹ Forum ‹ Programming ‹ Visual Basic Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Conversion from string "" to type 'Double' is not valid.
1 post
• Page 1 of 1
0
Conversion from string "" to type 'Double' is not valid.
Hello,
I am using a combobox to allow the user to choose what constant he will be using.
Here is the code for the combobox:
Private Sub cboChoosePipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboChoosePipe.SelectedIndexChanged
Select Case cboChoosePipe.Text
Case "HDPE"
Dim ThermalConductivityofCarrierPipe = HDPE
Case "PVC"
Dim ThermalConductivityofCarrierPipe = PVC
Case "ABS"
Dim ThermalConductivityofCarrierPipe = ABS
Case "FRP"
Dim ThermalConductivityofCarrierPipe = FRP
Case "Copper"
Dim ThermalConductivityofCarrierPipe = Copper
Case "Steel"
Dim ThermalConductivityofCarrierPipe = Steel
Case "Ductile Iron"
Dim ThermalConductivityofCarrierPipe = Ductileiron
End Select
End Sub
Now in the click even of my "Ok" button, I added this code :
ThermalConductivityofCarrierPipe = cboChoosePipe.SelectedText.ToString
I set the variable like this:
Public ThermalConductivityofCarrierPipe As Double
Now when ever I run the program I get this error:
Conversion from string "" to type 'Double' is not valid.
How can I make this work?
Thanks!
I am using a combobox to allow the user to choose what constant he will be using.
Here is the code for the combobox:
Private Sub cboChoosePipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboChoosePipe.SelectedIndexChanged
Select Case cboChoosePipe.Text
Case "HDPE"
Dim ThermalConductivityofCarrierPipe = HDPE
Case "PVC"
Dim ThermalConductivityofCarrierPipe = PVC
Case "ABS"
Dim ThermalConductivityofCarrierPipe = ABS
Case "FRP"
Dim ThermalConductivityofCarrierPipe = FRP
Case "Copper"
Dim ThermalConductivityofCarrierPipe = Copper
Case "Steel"
Dim ThermalConductivityofCarrierPipe = Steel
Case "Ductile Iron"
Dim ThermalConductivityofCarrierPipe = Ductileiron
End Select
End Sub
Now in the click even of my "Ok" button, I added this code :
ThermalConductivityofCarrierPipe = cboChoosePipe.SelectedText.ToString
I set the variable like this:
Public ThermalConductivityofCarrierPipe As Double
Now when ever I run the program I get this error:
Conversion from string "" to type 'Double' is not valid.
How can I make this work?
Thanks!
- Patricks
- Reputation: 0
- Posts: 1
- Joined: Wed Feb 16, 2011 9:08 pm
- Highscores: 0
- Arcade winning challenges: 0
Conversion from string "" to type 'Double' is not valid. - Sponsored results
- Sponsored results
|
|