Login        
 
   
Nederlands English
 






IFrame
 
VWD Visual Basic code

Place an button1, dropdownlist, textbox1 en textbox2 in the default.aspx and copy de next code into default.vb.

 
CodePrint
Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim text1 As Double
        text1 = TextBox1.Text
        'celsius
        If DropDownList1.SelectedValue = 12 Then
            TextBox2.Text = (text1 * 1.8 + 32)
        End If
        If DropDownList1.SelectedValue = 13 Then
            TextBox2.Text = text1 + 273.15
        End If
        If DropDownList1.SelectedValue = 14 Then
            TextBox2.Text = text1 * 1.8 + 32 + 459.67
        End If
        If DropDownList1.SelectedValue = 15 Then
            TextBox2.Text = text1 * 0.8
        End If
        'Fahrenheit
        If DropDownList1.SelectedValue = 21 Then
            TextBox2.Text = (text1 - 32) / 1.8
        End If
        If DropDownList1.SelectedValue = 23 Then
            TextBox2.Text = (text1 + 459.67) / 1.8
        End If
        If DropDownList1.SelectedValue = 24 Then
            TextBox2.Text = text1 + 459.67
        End If
        If DropDownList1.SelectedValue = 25 Then
            TextBox2.Text = (text1 - 32) / 2.25
        End If
        'Kelvin
        If DropDownList1.SelectedValue = 31 Then
            TextBox2.Text = text1 - 273.15
        End If
        If DropDownList1.SelectedValue = 32 Then
            TextBox2.Text = text1 * 1.8 - 459.67
        End If
        If DropDownList1.SelectedValue = 34 Then
            TextBox2.Text = text1 * 1.8
        End If
        If DropDownList1.SelectedValue = 35 Then
            TextBox2.Text = (text1 - 273.15) * 0.8
        End If
        'Rankine
        If DropDownList1.SelectedValue = 41 Then
            TextBox2.Text = (text1 - 32 - 459.67) / 1.8
        End If
        If DropDownList1.SelectedValue = 42 Then
            TextBox2.Text = text1 - 459.67
        End If
        If DropDownList1.SelectedValue = 43 Then
            TextBox2.Text = text1 / 1.8
        End If
        If DropDownList1.SelectedValue = 45 Then
            TextBox2.Text = (text1 - 32 - 459.67) / 2.25
        End If
        'Reaumur
        If DropDownList1.SelectedValue = 51 Then
            TextBox2.Text = text1 * 1.25
        End If
        If DropDownList1.SelectedValue = 52 Then
            TextBox2.Text = (text1 * 2.25) + 32
        End If
        If DropDownList1.SelectedValue = 53 Then
            TextBox2.Text = text1 * 1.25 + 273.15
        End If
        If DropDownList1.SelectedValue = 54 Then
            TextBox2.Text = text1 * 2.25 + 32 + 459.67
        End If
    End Sub
End Class
  HTML 4.01 Code
  ASCII Code
 
 

Links
 

  © Sappy.nl by Frank van Rooijen
   
website statistics