Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27365

VS 2010 Help with a program

$
0
0
I need help with a program I am creating.
First, some background..
I am using the 2010 Edition
This program has a simple GUI:
Fahrenheitlabel, FahrenheitTextBox
Celsiuslabel, CelsiusTextbox
a button
StateListbox

The Celsius textbox is meant for displaying the converted from Fahrenheit only. You should not be able to type anything into it.
The problem I am running across is with the displays, nothing shows up. I know it's probably something simple and I am trying to overcomplicate it.
I have tried several different variations and I keep getting errors.
Any help would be appreciated.

Here is the code:
Public Class Water

Private Sub StateButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TouchButton.Click

' declare variables
Dim fahrenheit As Integer
Dim formula As Integer
Dim state As String

' retrieve user input and assign values
fahrenheit = Val(FahrenheitTextBox.Text)
formula = (fahrenheit - 32) * (5 / 9)

Select Case fahrenheit ' check fahrenheit input
Case 0 To 32 ' fahrenheit between 0 and 32
state = "Water is freezing/ice, safe to touch"
Case 33 To 65
state = "Water is cold, safe to touch"
Case 66 To 96
state = "Water is cool, safe to touch"
Case 97 To 101
state = "Water is tepid, safe to touch"
Case 102 To 130
state = "Water is warm, safe to touch"
Case 131 To 211
state = "Water is very hot, DO NOT TOUCH"
Case 212 To 250
state = "Water is boiling, DO NOT TOUCH"
Case Else
state = "Please input a number between 0 and 250"
End Select

'remove text displayed in ListBox
StateListBox.Items.Clear()

End Sub
End Class

Viewing all articles
Browse latest Browse all 27365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>